Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit feea23e

Browse files
committedOct 12, 2014
fixing namespace to ruby-exec => RubyExec
1 parent f4883ab commit feea23e

File tree

12 files changed

+43
-45
lines changed

12 files changed

+43
-45
lines changed
 

‎lib/ruby/hooks.rb renamed to ‎lib/ruby-hooks.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
See the file LICENSE for copying permission.
55
=end
66

7-
require "ruby/hooks/version"
8-
require "ruby/hooks/instance_hooks"
7+
require "ruby-hooks/version"
8+
require "ruby-hooks/instance_hooks"

‎lib/ruby/hooks/extensible.rb renamed to ‎lib/ruby-hooks/extensible.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
See the file LICENSE for copying permission.
55
=end
66

7+
require "ruby-hooks/version"
8+
79
# Allow extending object with plugins(modules)
8-
module Ruby::Hooks::Extensible
10+
module RubyHooks::Extensible
911

1012
# handle single parameters as well as arrays of params
11-
# @param method [Symbol] name of the method to call
12-
# @param plugins [Array] call method for every element of array
13-
# @param plugins [Object] call method for the object
14-
# @returns :nodoc: - unperdictable
13+
# @param method [Symbol] name of the method to call
14+
# @param plugins [Object|Array] call method for object or every element of array
1515
def add_plugins(method, plugins = nil)
1616
case plugins
1717
when Array then plugins.each { |plugin| send(method, plugin) }

‎lib/ruby/hooks/hook.rb renamed to ‎lib/ruby-hooks/hook.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
=end
66

77
require "observer"
8-
require "ruby/hooks/extensible"
8+
require "ruby-hooks/extensible"
99

1010
# Wrapper for Observable module
11-
class Ruby::Hooks::Hook
11+
class RubyHooks::Hook
1212
include Observable
13-
include ::Ruby::Hooks::Extensible
13+
include ::RubyHooks::Extensible
1414

1515
# automatically extends Hook instance with given modules
1616
#

‎lib/ruby/hooks/instance_hooks.rb renamed to ‎lib/ruby-hooks/instance_hooks.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
See the file LICENSE for copying permission.
55
=end
66

7-
require "ruby/hooks/hook"
7+
require "ruby-hooks/hook"
88

99
# Helper to add multiple instance hooks
10-
module Ruby::Hooks::InstanceHooks
10+
module RubyHooks::InstanceHooks
1111

1212
# define instance hook method, it gives easy acces to Hook and
1313
# it's methods
@@ -21,7 +21,7 @@ def define_hook(name, options = {})
2121
if hook = instance_variable_get(:"@#{name}")
2222
then return hook
2323
end
24-
hook = Ruby::Hooks::Hook.new(options)
24+
hook = RubyHooks::Hook.new(options)
2525
instance_variable_set(:"@#{name}", hook)
2626
hook
2727
end

‎lib/ruby-hooks/version.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
=begin
2+
Copyright 2014 Michal Papis <mpapis@gmail.com>
3+
4+
See the file LICENSE for copying permission.
5+
=end
6+
7+
# Helpers for multiple publish/subscribe hooks
8+
module RubyHooks
9+
# version of ruby-hooks gem
10+
VERSION = "1.1.0"
11+
end
12+

‎lib/ruby/hooks/version.rb

Lines changed: 0 additions & 14 deletions
This file was deleted.

‎ruby-hooks.gemspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env ruby
22
# -*- encoding: utf-8 -*-
3-
# stub: PLUGINATOR ruby lib
3+
# stub: ruby-hooks ruby lib
44

55
=begin
66
Copyright 2014 Michal Papis <mpapis@gmail.com>
@@ -11,11 +11,11 @@ See the file LICENSE for copying permission.
1111
lib = File.expand_path("../lib/", __FILE__)
1212
$:.unshift lib unless $:.include?(lib)
1313

14-
require "ruby/hooks/version"
14+
require "ruby-hooks/version"
1515

1616
Gem::Specification.new do |spec|
1717
spec.name = "ruby-hooks"
18-
spec.version = ::Ruby::Hooks::VERSION
18+
spec.version = ::RubyHooks::VERSION
1919
spec.licenses = ["MIT"]
2020

2121
spec.authors = ["Michal Papis"]

‎test/example1_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
=end
66

77
require "test_helper"
8-
require "ruby/hooks"
8+
require "ruby-hooks"
99

1010
class Test1
11-
extend Ruby::Hooks::InstanceHooks
11+
extend RubyHooks::InstanceHooks
1212
define_hook(:my_event_one)
1313
end
1414

@@ -26,7 +26,7 @@ def log(x)
2626
end
2727
end
2828

29-
describe Ruby::Hooks::Extensible do
29+
describe RubyHooks::Extensible do
3030
subject do
3131
Test1.new
3232
end

‎test/example2_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
=end
66

77
require "test_helper"
8-
require "ruby/hooks"
8+
require "ruby-hooks"
99

1010
module FindObserver
1111
def find_observer(*arg)
@@ -24,7 +24,7 @@ def find_observer(*arg)
2424
end
2525

2626
class Test2
27-
extend Ruby::Hooks::InstanceHooks
27+
extend RubyHooks::InstanceHooks
2828
define_hook(:my_event_two, :extends => FindObserver)
2929
end
3030

@@ -40,7 +40,7 @@ def test_me(x)
4040
end
4141
end
4242

43-
describe Ruby::Hooks::Extensible do
43+
describe RubyHooks::Extensible do
4444
subject do
4545
Test2.new
4646
end

‎test/ruby/hooks/extensible_test.rb renamed to ‎test/ruby-hooks/extensible_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
=end
66

77
require "test_helper"
8-
require "ruby/hooks/extensible"
8+
require "ruby-hooks/extensible"
99

1010
class ExtensibleTestClass
11-
include Ruby::Hooks::Extensible
11+
include RubyHooks::Extensible
1212
attr_reader :calls
1313
def initialize
1414
@calls = []
@@ -28,7 +28,7 @@ module Test3
2828
end
2929
end
3030

31-
describe Ruby::Hooks::Extensible do
31+
describe RubyHooks::Extensible do
3232
subject do
3333
ExtensibleTestClass.new
3434
end

‎test/ruby/hooks/hook_test.rb renamed to ‎test/ruby-hooks/hook_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
=end
66

77
require "test_helper"
8-
require "ruby/hooks/hook"
8+
require "ruby-hooks/hook"
99

1010
class HookTestClass
1111
module Extra
@@ -20,9 +20,9 @@ def update(value)
2020
end
2121
end
2222

23-
describe Ruby::Hooks::Hook do
23+
describe RubyHooks::Hook do
2424
subject do
25-
Ruby::Hooks::Hook.allocate
25+
RubyHooks::Hook.allocate
2626
end
2727

2828
it "is based on Observable" do

‎test/ruby/hooks/instance_hooks_test.rb renamed to ‎test/ruby-hooks/instance_hooks_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
=end
66

77
require "test_helper"
8-
require "ruby/hooks/instance_hooks"
8+
require "ruby-hooks/instance_hooks"
99

1010
class InstanceHooksTestClass
1111
module Extra
1212
def method3
1313
end
1414
end
15-
extend Ruby::Hooks::InstanceHooks
15+
extend RubyHooks::InstanceHooks
1616
define_hook(:test1)
1717
define_hook(:test2, :extends => Extra)
1818
end
1919

20-
describe Ruby::Hooks::Extensible do
20+
describe RubyHooks::Extensible do
2121
subject do
2222
InstanceHooksTestClass.new
2323
end

0 commit comments

Comments
 (0)
Please sign in to comment.