diff options
author | Samuel E. Giddins <segiddins@segiddins.me> | 2015-05-01 21:45:35 -0700 |
---|---|---|
committer | Samuel E. Giddins <segiddins@segiddins.me> | 2015-05-01 21:45:35 -0700 |
commit | ff897c49ed6047593a119bfd224b9c9c96edafa3 (patch) | |
tree | e744d93f535aa43f8c91d040355619d8ac055463 /lib | |
parent | d386ed1b342711fb3d307a7ca640cafc64b3be85 (diff) | |
download | bundler-ff897c49ed6047593a119bfd224b9c9c96edafa3.tar.gz |
[RubyGems] Allow standalone caching of builtin gems
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/source/rubygems.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index 66a0b72a..1b43d2e1 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -86,7 +86,15 @@ module Bundler end def install(spec, force = false) - return ["Using #{version_message(spec)}", nil] if installed_specs[spec].any? && !force + if builtin_gem?(spec) + if builtin_requires_caching = !cached_path(spec) + cached_built_in_gem(spec) + else + spec.loaded_from = loaded_from(spec) + end + end + return ["Using #{version_message(spec)}", nil] if installed_specs[spec].any? && !force && !builtin_requires_caching + # Download the gem to get the spec, because some specs that are returned # by rubygems.org are broken and wrong. |