summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsutosh Palai <asupalai@gmail.com>2016-08-04 21:34:38 +0530
committerAsutosh Palai <asupalai@gmail.com>2016-08-16 09:48:27 +0530
commit7a0c4b01e54b94a70a738f122e8d6a936755524f (patch)
tree7266a4796e68baa9c8a746c5e06c5e710662821a
parent8b3d03988f5abbc91f1c563ea93d1eaec3623a4c (diff)
downloadbundler-7a0c4b01e54b94a70a738f122e8d6a936755524f.tar.gz
Fixed empty hooks in index file
-rw-r--r--lib/bundler/plugin/index.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/bundler/plugin/index.rb b/lib/bundler/plugin/index.rb
index 35851a3df9..0b4769f542 100644
--- a/lib/bundler/plugin/index.rb
+++ b/lib/bundler/plugin/index.rb
@@ -24,7 +24,7 @@ module Bundler
@plugin_paths = {}
@commands = {}
@sources = {}
- @hooks = Hash.new {|h, k| h[k] = [] }
+ @hooks = {}
@load_paths = {}
load_index(global_index_file, true)
@@ -51,7 +51,7 @@ module Bundler
raise SourceConflict.new(name, common) unless common.empty?
sources.each {|k| @sources[k] = name }
- hooks.each {|e| @hooks[e] << name }
+ hooks.each {|e| (@hooks[e] ||= []) << name }
@plugin_paths[name] = path
@load_paths[name] = load_paths
@@ -102,7 +102,7 @@ module Bundler
end
def hook_plugins(event)
- @hooks[event]
+ @hooks[event] || []
end
private