aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/plugin.rb
diff options
context:
space:
mode:
authorAsutosh Palai <asupalai@gmail.com>2016-07-27 00:24:31 +0530
committerAsutosh Palai <asupalai@gmail.com>2016-08-16 09:48:27 +0530
commit1cc0050e8a6791bc908fd92199804762aaa43fc7 (patch)
treefb824c8b36ce8f40c4f8e88c3fa32e00b448dafb /lib/bundler/plugin.rb
parentb5094c0377cc1cc9642a7f6a477a31c1db304aeb (diff)
downloadbundler-1cc0050e8a6791bc908fd92199804762aaa43fc7.tar.gz
Added passing blocks to hooks
Diffstat (limited to 'lib/bundler/plugin.rb')
-rw-r--r--lib/bundler/plugin.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/bundler/plugin.rb b/lib/bundler/plugin.rb
index e022e890..bf1996e3 100644
--- a/lib/bundler/plugin.rb
+++ b/lib/bundler/plugin.rb
@@ -149,13 +149,13 @@ module Bundler
@hooks_by_event[event.to_s] << block
end
- def hook(event, *args)
+ def hook(event, *args, &arg_blk)
plugins = index.hook_plugins(event)
- return unless plugins
+ return unless plugins.any?
(plugins - @loaded_plugin_names).each {|name| load_plugin(name) }
- @hooks_by_event[event].each {|blk| blk.call(*args) }
+ @hooks_by_event[event].each {|blk| blk.call(*args, &arg_blk) }
end
# currently only intended for specs