method_callbacks 1.2.1 → 1.2.2

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: ba8dff1ccdad716d4f7a3621e44af91c523f1e12
4
- data.tar.gz: 8a7b5b9efe3cd8da572b175310b74749e6047894
3
+ metadata.gz: 0c8c9a7d4add55532337105dce6633cd8b5ad1fd
4
+ data.tar.gz: f72844fdae422df415f8214cf29138af8ff1581e
5
5
  SHA512:
6
- metadata.gz: 045d53539c4410517b8dca5831f3499e08e3e5d081182f8c53a7264ba92005f9beb50b9ce030e42677d45e70d628bd161c456daab867e3a1f8510bda7f45a143
7
- data.tar.gz: c365b942d95db6db0af206b827c94994d9b99d7918f2282e212240d7fc40da4879fb48303586c118556c685378094584b52e9a7b1c50022be18aad0ecaa975dc
6
+ metadata.gz: 1c6f3d6c4a2b1e9c83151cbb67dda0dd5355ae25e1c1e694b21ea7ad9ed984ae60f67053e1759dc1c91db528668c24402f3e16aa04358ef6fc820027a5c6b6e5
7
+ data.tar.gz: 7a58babe58bb6bf3a61498e3210dbe56e518abac38a79f260514c3a05a1342e6c6d5e00f379e8bfe8ba8168b409d32c2ebd6c65ef705639b6151080b2899820f
data/.travis.yml CHANGED
@@ -10,6 +10,6 @@ script: 'bundle exec rake'
10
10
  notifications:
11
11
  email:
12
12
  recipients:
13
- - showactive@gmail.com
13
+ - morganshowman@gmail.com
14
14
  on_failure: change
15
15
  on_success: never
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ 1.2.2 / 2014-06-20
2
+ * Fix defining callbacks before method
3
+
1
4
  1.2.1 / 2014-06-18
2
5
  * Rename private methods to avoid naming collisions
3
6
 
@@ -50,8 +50,8 @@ module MethodCallbacks
50
50
  method
51
51
  end
52
52
 
53
- def __method_callbacks_method_added(method_name)
54
- __method_callbacks_redefine_method(find(method_name))
53
+ def method_added(method_name)
54
+ __method_callbacks_redefine_method(__method_callbacks_find(method_name))
55
55
 
56
56
  super
57
57
  end
@@ -1,3 +1,3 @@
1
1
  module MethodCallbacks
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.2"
3
3
  end
@@ -20,6 +20,18 @@ describe MethodCallbacks do
20
20
  expect(test_callbacks.action).to eq("Return value")
21
21
  end
22
22
 
23
+ it "should work when callbacks defined before method definition" do
24
+ expect(test_callbacks).to receive(:puts).with("Executing intro")
25
+
26
+ expect(test_callbacks.test_define_before_method).to eq("Executing test_define_before_method")
27
+ end
28
+
29
+ it "should work when callbacks defined after method definition" do
30
+ expect(test_callbacks).to receive(:puts).with("Executing unload")
31
+
32
+ expect(test_callbacks.test_define_after_method).to eq("Executing test_define_after_method")
33
+ end
34
+
23
35
  it "should proxy the result" do
24
36
  expect(test_proxy_result.result).to eq("the original result was: hello!")
25
37
  end
@@ -85,6 +97,16 @@ class TestCallbacks
85
97
  puts "Executing post inner_around"
86
98
  return_value
87
99
  end
100
+
101
+ before_method :test_define_before_method, :intro
102
+ def test_define_before_method
103
+ "Executing test_define_before_method"
104
+ end
105
+
106
+ def test_define_after_method
107
+ "Executing test_define_after_method"
108
+ end
109
+ after_method :test_define_after_method, :unload
88
110
  end
89
111
 
90
112
  class TestProxyResult
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: method_callbacks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Morgan Showman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-18 00:00:00.000000000 Z
11
+ date: 2014-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  version_requirements: !ruby/object:Gem::Requirement