diff options
author | Asutosh Palai <asupalai@gmail.com> | 2016-07-27 00:24:31 +0530 |
---|---|---|
committer | Asutosh Palai <asupalai@gmail.com> | 2016-08-16 09:48:27 +0530 |
commit | 1cc0050e8a6791bc908fd92199804762aaa43fc7 (patch) | |
tree | fb824c8b36ce8f40c4f8e88c3fa32e00b448dafb /lib/bundler/plugin.rb | |
parent | b5094c0377cc1cc9642a7f6a477a31c1db304aeb (diff) | |
download | bundler-1cc0050e8a6791bc908fd92199804762aaa43fc7.tar.gz |
Added passing blocks to hooks
Diffstat (limited to 'lib/bundler/plugin.rb')
-rw-r--r-- | lib/bundler/plugin.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/bundler/plugin.rb b/lib/bundler/plugin.rb index e022e890e5..bf1996e36a 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 |