summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHemant Kumar <gethemant@gmail.com>2014-04-02 22:35:26 -0400
committerHemant Kumar <gethemant@gmail.com>2014-04-02 22:35:26 -0400
commita4ee812fcb13de0d2b0cc846e69b6166c2a93142 (patch)
tree7ed39b7486b13ad939c4c064d94c71b3718562f8
parentf830babea5a31e5e520747c03bda2247406de1a1 (diff)
downloadbundler-fix-bug-with-bundle-cache-erroring.tar.gz
Use loaded_from only when non-nilfix-bug-with-bundle-cache-erroring
For a gem which is not installed in specified path "loaded_from" will return nil and hence check for builtin_gem? will throw error. This fixes bug#2915
-rw-r--r--lib/bundler/source/rubygems.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index 3d84df45cd..5e6438e9fc 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -292,11 +292,10 @@ module Bundler
end
def builtin_gem?(spec)
- # Ruby 2.1-style
- return true if spec.summary =~ /is bundled with Ruby/
-
- # Ruby 2.0 style
- spec.loaded_from.include?("specifications/default/")
+ # gems bundled with ruby have summary as - "is bundled with ruby"
+ # or else use "specifications/default" to store the gemspecs.
+ spec.summary =~ /is bundled with Ruby/ ||
+ (spec.loaded_from && spec.loaded_from.include?("specifications/default/"))
end
end
end