ruby-hooks 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3d1ab49d7471dbf83250ef6097e8633e42cf5029
4
- data.tar.gz: 031177c8eaf440f8f907ab6aa659df19945f277c
3
+ metadata.gz: 34102235069c4f0a18da548ae0a791374c78c048
4
+ data.tar.gz: e6ce9521271058c79eb8f1c60457eda4d730780c
5
5
  SHA512:
6
- metadata.gz: f43eaed97d10494d1d899e50dbb5903eaf6aa95508cd10a23201010af5e527f8248ddeeb13a0bb286ee64e5854f644a03cf34b9df39ab6e4b548a2b41180f4a3
7
- data.tar.gz: fdcd36619942ba0cd4c35485c9dc1e4ba023e29518dc03b1b7aced17b8eae2a450732c073e0b2cbe660724988aad6fc765972639a22a749f97e2efec6cbeb6e0
6
+ metadata.gz: 01df655d5584bc2c1a1319051d0ddbe990de8ff5f2f8cf975d7417c89b81e3fd480dc038b77466eadaa159faad9981d2e517568426609bc6df35032b5854f531
7
+ data.tar.gz: 56901eaa67e91ec0d39f4a81784ecd62596476f2e797068c6b759c87d91a9fbffc0fe05801aeac6866d9ae83512ac76d4a70b621e1681e40bbf51b03844efa6c
@@ -4,5 +4,5 @@ Copyright 2014 Michal Papis <mpapis@gmail.com>
4
4
  See the file LICENSE for copying permission.
5
5
  =end
6
6
 
7
- require "ruby/hooks/version"
8
- require "ruby/hooks/instance_hooks"
7
+ require "ruby-hooks/version"
8
+ require "ruby-hooks/instance_hooks"
@@ -4,14 +4,14 @@ Copyright 2014 Michal Papis <mpapis@gmail.com>
4
4
  See the file LICENSE for copying permission.
5
5
  =end
6
6
 
7
+ require "ruby-hooks/version"
8
+
7
9
  # Allow extending object with plugins(modules)
8
- module Ruby::Hooks::Extensible
10
+ module RubyHooks::Extensible
9
11
 
10
12
  # 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
15
15
  def add_plugins(method, plugins = nil)
16
16
  case plugins
17
17
  when Array then plugins.each { |plugin| send(method, plugin) }
@@ -5,12 +5,12 @@ See the file LICENSE for copying permission.
5
5
  =end
6
6
 
7
7
  require "observer"
8
- require "ruby/hooks/extensible"
8
+ require "ruby-hooks/extensible"
9
9
 
10
10
  # Wrapper for Observable module
11
- class Ruby::Hooks::Hook
11
+ class RubyHooks::Hook
12
12
  include Observable
13
- include ::Ruby::Hooks::Extensible
13
+ include ::RubyHooks::Extensible
14
14
 
15
15
  # automatically extends Hook instance with given modules
16
16
  #
@@ -4,10 +4,10 @@ Copyright 2014 Michal Papis <mpapis@gmail.com>
4
4
  See the file LICENSE for copying permission.
5
5
  =end
6
6
 
7
- require "ruby/hooks/hook"
7
+ require "ruby-hooks/hook"
8
8
 
9
9
  # Helper to add multiple instance hooks
10
- module Ruby::Hooks::InstanceHooks
10
+ module RubyHooks::InstanceHooks
11
11
 
12
12
  # define instance hook method, it gives easy acces to Hook and
13
13
  # it's methods
@@ -21,7 +21,7 @@ module Ruby::Hooks::InstanceHooks
21
21
  if hook = instance_variable_get(:"@#{name}")
22
22
  then return hook
23
23
  end
24
- hook = Ruby::Hooks::Hook.new(options)
24
+ hook = RubyHooks::Hook.new(options)
25
25
  instance_variable_set(:"@#{name}", hook)
26
26
  hook
27
27
  end
@@ -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.2.0"
11
+ end
12
+
@@ -5,10 +5,10 @@ See the file LICENSE for copying permission.
5
5
  =end
6
6
 
7
7
  require "test_helper"
8
- require "ruby/hooks"
8
+ require "ruby-hooks"
9
9
 
10
10
  class Test1
11
- extend Ruby::Hooks::InstanceHooks
11
+ extend RubyHooks::InstanceHooks
12
12
  define_hook(:my_event_one)
13
13
  end
14
14
 
@@ -26,7 +26,7 @@ class Observer2
26
26
  end
27
27
  end
28
28
 
29
- describe Ruby::Hooks::Extensible do
29
+ describe RubyHooks::Extensible do
30
30
  subject do
31
31
  Test1.new
32
32
  end
@@ -5,7 +5,7 @@ See the file LICENSE for copying permission.
5
5
  =end
6
6
 
7
7
  require "test_helper"
8
- require "ruby/hooks"
8
+ require "ruby-hooks"
9
9
 
10
10
  module FindObserver
11
11
  def find_observer(*arg)
@@ -24,7 +24,7 @@ module FindObserver
24
24
  end
25
25
 
26
26
  class Test2
27
- extend Ruby::Hooks::InstanceHooks
27
+ extend RubyHooks::InstanceHooks
28
28
  define_hook(:my_event_two, :extends => FindObserver)
29
29
  end
30
30
 
@@ -40,7 +40,7 @@ class Observer4
40
40
  end
41
41
  end
42
42
 
43
- describe Ruby::Hooks::Extensible do
43
+ describe RubyHooks::Extensible do
44
44
  subject do
45
45
  Test2.new
46
46
  end
@@ -5,10 +5,10 @@ See the file LICENSE for copying permission.
5
5
  =end
6
6
 
7
7
  require "test_helper"
8
- require "ruby/hooks/extensible"
8
+ require "ruby-hooks/extensible"
9
9
 
10
10
  class ExtensibleTestClass
11
- include Ruby::Hooks::Extensible
11
+ include RubyHooks::Extensible
12
12
  attr_reader :calls
13
13
  def initialize
14
14
  @calls = []
@@ -28,7 +28,7 @@ class ExtensibleTestClass
28
28
  end
29
29
  end
30
30
 
31
- describe Ruby::Hooks::Extensible do
31
+ describe RubyHooks::Extensible do
32
32
  subject do
33
33
  ExtensibleTestClass.new
34
34
  end
@@ -5,7 +5,7 @@ See the file LICENSE for copying permission.
5
5
  =end
6
6
 
7
7
  require "test_helper"
8
- require "ruby/hooks/hook"
8
+ require "ruby-hooks/hook"
9
9
 
10
10
  class HookTestClass
11
11
  module Extra
@@ -20,9 +20,9 @@ class HookTestClass
20
20
  end
21
21
  end
22
22
 
23
- describe Ruby::Hooks::Hook do
23
+ describe RubyHooks::Hook do
24
24
  subject do
25
- Ruby::Hooks::Hook.allocate
25
+ RubyHooks::Hook.allocate
26
26
  end
27
27
 
28
28
  it "is based on Observable" do
@@ -5,19 +5,19 @@ See the file LICENSE for copying permission.
5
5
  =end
6
6
 
7
7
  require "test_helper"
8
- require "ruby/hooks/instance_hooks"
8
+ require "ruby-hooks/instance_hooks"
9
9
 
10
10
  class InstanceHooksTestClass
11
11
  module Extra
12
12
  def method3
13
13
  end
14
14
  end
15
- extend Ruby::Hooks::InstanceHooks
15
+ extend RubyHooks::InstanceHooks
16
16
  define_hook(:test1)
17
17
  define_hook(:test2, :extends => Extra)
18
18
  end
19
19
 
20
- describe Ruby::Hooks::Extensible do
20
+ describe RubyHooks::Extensible do
21
21
  subject do
22
22
  InstanceHooksTestClass.new
23
23
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-hooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Papis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-10 00:00:00.000000000 Z
11
+ date: 2014-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: yard-ruby-hooks
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rake
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -45,16 +59,16 @@ executables: []
45
59
  extensions: []
46
60
  extra_rdoc_files: []
47
61
  files:
48
- - lib/ruby/hooks.rb
49
- - lib/ruby/hooks/extensible.rb
50
- - lib/ruby/hooks/hook.rb
51
- - lib/ruby/hooks/instance_hooks.rb
52
- - lib/ruby/hooks/version.rb
62
+ - lib/ruby-hooks.rb
63
+ - lib/ruby-hooks/extensible.rb
64
+ - lib/ruby-hooks/hook.rb
65
+ - lib/ruby-hooks/instance_hooks.rb
66
+ - lib/ruby-hooks/version.rb
53
67
  - test/example1_test.rb
54
68
  - test/example2_test.rb
55
- - test/ruby/hooks/extensible_test.rb
56
- - test/ruby/hooks/hook_test.rb
57
- - test/ruby/hooks/instance_hooks_test.rb
69
+ - test/ruby-hooks/extensible_test.rb
70
+ - test/ruby-hooks/hook_test.rb
71
+ - test/ruby-hooks/instance_hooks_test.rb
58
72
  - test/test_helper.rb
59
73
  homepage: https://github.com/remote-exec/ruby-hooks
60
74
  licenses:
@@ -76,15 +90,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
90
  version: '0'
77
91
  requirements: []
78
92
  rubyforge_project:
79
- rubygems_version: 2.4.2
93
+ rubygems_version: 2.2.2
80
94
  signing_key:
81
95
  specification_version: 4
82
96
  summary: Helpers for multiple publish/subscribe hooks
83
97
  test_files:
84
- - test/ruby/hooks/extensible_test.rb
85
- - test/ruby/hooks/instance_hooks_test.rb
86
- - test/ruby/hooks/hook_test.rb
87
98
  - test/test_helper.rb
88
- - test/example2_test.rb
89
99
  - test/example1_test.rb
100
+ - test/example2_test.rb
101
+ - test/ruby-hooks/extensible_test.rb
102
+ - test/ruby-hooks/hook_test.rb
103
+ - test/ruby-hooks/instance_hooks_test.rb
90
104
  has_rdoc:
@@ -1,14 +0,0 @@
1
- =begin
2
- Copyright 2014 Michal Papis <mpapis@gmail.com>
3
-
4
- See the file LICENSE for copying permission.
5
- =end
6
-
7
- module Ruby
8
- # Helpers for multiple publish/subscribe hooks
9
- module Hooks
10
- # Rubygems version of Ruby::Hooks
11
- VERSION = "1.1.0"
12
- end
13
- end
14
-