CallBaecker 0.0.2 → 0.0.3

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: d412a814b599236b6d93ef668dda1bcd94f44f19
4
- data.tar.gz: 4ae56bd1805a25100cc6538984f2588ec76b7fa1
3
+ metadata.gz: c4976db8687de742373453ee657e26d46c2fc86c
4
+ data.tar.gz: e18da3c5922e39acc38ef8b5ff915016ab8e2edf
5
5
  SHA512:
6
- metadata.gz: 8a1d555040dcb2a6a08a7f8eb2b1c28cefcee1a6ded030a054c26216a79f9986c626c295d8774f4dfc4202086aeb9ff5fe0b5ce3bbe2a62af4c683c99a0f84b1
7
- data.tar.gz: 415db5b62eb411ca589864243fa3f8cfbec9a75b2131f5f171bf55dc747240eb43956f77a517a8d836421824217e8bcc102717629552ac5076c6fd7b4eff42b1
6
+ metadata.gz: 4b420e926c273b49b4e9445b7df24ba2cdffbb64fab3d214b5690ead0f14946157cf9b53af8d7bf66f14fe7e1315dd7a723ae470129f307364f35dd932eacd9a
7
+ data.tar.gz: 87fb50c96ec93b2a4bba0a185363a0d381e22211726a3c88a7d9df306de837f0f4b5e0e67a03b2e28e9fd6670e3b48ef9232a4bcad4018cb3a473e93526b7f7d
data/lib/CallBaecker.rb CHANGED
@@ -22,13 +22,14 @@ module CallBaecker
22
22
  @__last_methods_added = [name, with, without]
23
23
  _self = self
24
24
  define_method with do |*args, &block|
25
+ callee = caller.first
25
26
  @__last_args = *args
26
27
  catch :CallBaeckerDone do
27
28
  # before hook
28
29
  # TODO make it pluggable
29
30
  # it shouldnt be limited to rubisierung
30
31
  if has_before_hook
31
- *args = _self.instance_variable_get(:@__before_hook).call(params, args[0])
32
+ *args = _self.instance_variable_get(:@__before_hook).call(params, args[0], callee)
32
33
  end
33
34
  send without, *args, &block
34
35
  end
@@ -56,12 +57,13 @@ module CallBaecker
56
57
  @__last_methods_added = [name, with, without]
57
58
  define_singleton_method with do |*args, &block|
58
59
  @__last_args = *args
60
+ callee = caller.first
59
61
  catch :CallBaeckerDone do
60
62
  # before hook
61
63
  # TODO make it pluggable
62
64
  # it shouldnt be limited to rubisierung
63
65
  if has_before_hook
64
- *args = @__before_hook.call(params, args[0])
66
+ *args = @__before_hook.call(params, args[0], callee)
65
67
  end
66
68
  send without, *args, &block
67
69
  end
@@ -1,3 +1,3 @@
1
1
  module CallBaecker
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: CallBaecker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - doodzik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-30 00:00:00.000000000 Z
11
+ date: 2014-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler