Skip to content

Commit

Permalink
Don't swallow LoadErrors when requiring a dashed gem
Browse files Browse the repository at this point in the history
This looks like rubygems#1807

when raising a LoadError in a required gem, bundler will rescue it to try and see if it came from his own namespaced require or from the required file.

If it comes from the dashed require it will re-raise the original exception in case the gem was dashed but the first require was ok but raised a LoadError after.

However, the exception is swallowed if we require a dashed gem without the proper file name, for example gem name : 'foo-bar' and file architecture : 'foo/bar.rb'

This PR raise the exception back in case it really comes from inside the namespaced file.
  • Loading branch information
Intrepidd authored and Adrien Siami committed Oct 1, 2014
1 parent 9772abe commit 6482dac
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/bundler/runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def require(*groups)
regex_name = $1
raise e if dep.autorequire || (regex_name && regex_name.gsub('-', '/') != namespaced_file)
raise e if regex_name.nil?
raise
end
end
end
Expand Down

0 comments on commit 6482dac

Please sign in to comment.