summaryrefslogtreecommitdiff
path: root/lib/bundler/source/path.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/source/path.rb')
-rw-r--r--lib/bundler/source/path.rb18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb
index 292412044c..4192015cb7 100644
--- a/lib/bundler/source/path.rb
+++ b/lib/bundler/source/path.rb
@@ -132,11 +132,10 @@ module Bundler
if File.directory?(expanded_path)
# We sort depth-first since `<<` will override the earlier-found specs
Dir["#{expanded_path}/#{@glob}"].sort_by {|p| -p.split(File::SEPARATOR).size }.each do |file|
- if spec = Bundler.load_gemspec(file, :validate)
- spec.loaded_from = file.to_s
- spec.source = self
- index << spec
- end
+ next unless spec = Bundler.load_gemspec(file, :validate)
+ spec.loaded_from = file.to_s
+ spec.source = self
+ index << spec
end
if index.empty? && @name && @version
@@ -212,11 +211,10 @@ module Bundler
return unless Gem.respond_to?(hooks_meth)
Gem.send(hooks_meth).each do |hook|
result = hook.call(installer)
- if result == false
- location = " at #{$1}" if hook.inspect =~ /@(.*:\d+)/
- message = "#{type} hook#{location} failed for #{installer.spec.full_name}"
- raise InstallHookError, message
- end
+ next unless result == false
+ location = " at #{$1}" if hook.inspect =~ /@(.*:\d+)/
+ message = "#{type} hook#{location} failed for #{installer.spec.full_name}"
+ raise InstallHookError, message
end
end
end