summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel E. Giddins <segiddins@segiddins.me>2015-05-01 23:28:58 -0700
committerSamuel E. Giddins <segiddins@segiddins.me>2015-05-01 23:28:58 -0700
commite5002e5030cc2e8142ede153afe4c28a8db21ff0 (patch)
tree10015edb1b8ba1de8c63a9d7bf1993da11c7606a
parentff897c49ed6047593a119bfd224b9c9c96edafa3 (diff)
downloadbundler-seg-standalone-builtin.tar.gz
Only force caching of default gems when installing standaloneseg-standalone-builtin
-rw-r--r--lib/bundler/installer.rb6
-rw-r--r--lib/bundler/source/rubygems.rb15
2 files changed, 14 insertions, 7 deletions
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb
index 0e72f5a17b..d0a7dc4fda 100644
--- a/lib/bundler/installer.rb
+++ b/lib/bundler/installer.rb
@@ -102,13 +102,15 @@ module Bundler
settings = Bundler.settings["build.#{spec.name}"]
messages = nil
+ install_options = { :force => force, :ensure_builtin_gems_cached => standalone }
+
if settings
# Build arguments are global, so this is mutexed
Bundler.rubygems.with_build_args [settings] do
- messages = spec.source.install(spec, force)
+ messages = spec.source.install(spec, install_options)
end
else
- messages = spec.source.install(spec, force)
+ messages = spec.source.install(spec, install_options)
end
install_message, post_install_message, debug_message = *messages
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index 1b43d2e11f..b9e3920db0 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -85,15 +85,20 @@ module Bundler
end
end
- def install(spec, force = false)
- if builtin_gem?(spec)
- if builtin_requires_caching = !cached_path(spec)
- cached_built_in_gem(spec)
+ def install(spec, opts = {})
+ force = opts[:force]
+ ensure_builtin_gems_cached = opts[:ensure_builtin_gems_cached]
+
+ if ensure_builtin_gems_cached && builtin_gem?(spec)
+ if !cached_path(spec)
+ cached_built_in_gem(spec) unless spec.remote
+ force = true
else
spec.loaded_from = loaded_from(spec)
end
end
- return ["Using #{version_message(spec)}", nil] if installed_specs[spec].any? && !force && !builtin_requires_caching
+
+ return ["Using #{version_message(spec)}", nil] if installed_specs[spec].any? && !force
# Download the gem to get the spec, because some specs that are returned