cpt_hook 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cpt_hook/hookable.rb +2 -1
- data/lib/cpt_hook/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74f93a1da89cc4dc1b52ea059d17a148432734ae
|
4
|
+
data.tar.gz: 9e73cecbe75bf44df3b5e2c18490741d83c66b87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '092e9dbbcd208b37cc42779ad2f6b2cc3f8fe613fae038acaaa13c4e2e9793281ceefdc2a12e098ad177af3d9049d8b1c88db5bcd5c9a01ef6ed44b925427597'
|
7
|
+
data.tar.gz: 235607f27dda02ec5777496e9f65c1d934bb2a59ea39d98a072e3fea541f025a699067c1e7cab5399bee998daeb334b90c712538b890cfbcffc47359fee1d5d3
|
data/lib/cpt_hook/hookable.rb
CHANGED
@@ -35,7 +35,8 @@ module CptHook
|
|
35
35
|
hook[:contexts] = hook.fetch(:contexts, []).concat(additional_contexts)
|
36
36
|
define_singleton_method("#{which}_#{hook[which]}") do |*args, &block|
|
37
37
|
hook[:call_chain].each do |call_chain|
|
38
|
-
call_args = call_chain.fetch(:with, [])
|
38
|
+
call_args = call_chain.fetch(:with, []).map { |ca| ca == :self ? self : ca }
|
39
|
+
|
39
40
|
hook_fn = call_chain[:call]
|
40
41
|
if hook_fn.is_a?(Proc)
|
41
42
|
hook_fn.call(*call_args)
|
data/lib/cpt_hook/version.rb
CHANGED