diff options
author | Hemant Kumar <gethemant@gmail.com> | 2014-04-02 22:35:26 -0400 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2014-04-07 09:27:16 +0700 |
commit | 8a4e89b75b3df94d3d21184bdf5075c00c036f29 (patch) | |
tree | 5c0f0b529ef1d4da006b38f6286d1f5cd8e796d5 | |
parent | 8addf4a42b48728547029305c64b72ab9535eec7 (diff) | |
download | bundler-8a4e89b75b3df94d3d21184bdf5075c00c036f29.tar.gz |
Use loaded_from only when non-nil
For a gem which is not installed in specified path
"loaded_from" will return nil and hence check for builtin_gem?
will throw error.
Fixes #2915, #2963
-rw-r--r-- | lib/bundler/source/rubygems.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index 3d84df45cd..5dd7506604 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -292,11 +292,11 @@ module Bundler end def builtin_gem?(spec) - # Ruby 2.1-style + # Ruby 2.1, where all included gems have this summary return true if spec.summary =~ /is bundled with Ruby/ - # Ruby 2.0 style - spec.loaded_from.include?("specifications/default/") + # Ruby 2.0, where gemspecs are stored in specifications/default/ + spec.loaded_from && spec.loaded_from.include?("specifications/default/") end end end |