diff options
Diffstat (limited to 'lib/bundler/source')
| -rw-r--r-- | lib/bundler/source/git.rb | 5 | ||||
| -rw-r--r-- | lib/bundler/source/path.rb | 7 | ||||
| -rw-r--r-- | lib/bundler/source/path/installer.rb | 1 | ||||
| -rw-r--r-- | lib/bundler/source/rubygems.rb | 8 |
4 files changed, 19 insertions, 2 deletions
diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb index fd8f6debea..c21dc75e54 100644 --- a/lib/bundler/source/git.rb +++ b/lib/bundler/source/git.rb @@ -219,6 +219,11 @@ module Bundler end end + def extension_cache_path(spec) + return unless Bundler.feature_flag.global_gem_cache? + cache_path.join("extensions", Bundler.ruby_scope, spec.full_name) + end + def app_cache_dirname "#{base_name}-#{shortref_for_path(cached_revision || revision)}" end diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb index 806ba81935..64d00e2ec6 100644 --- a/lib/bundler/source/path.rb +++ b/lib/bundler/source/path.rb @@ -227,7 +227,8 @@ module Bundler spec, :env_shebang => false, :disable_extensions => options[:disable_extensions], - :build_args => options[:build_args] + :build_args => options[:build_args], + :bundler_extension_cache_path => extension_cache_path(spec) ) installer.post_install rescue Gem::InvalidSpecificationException => e @@ -243,6 +244,10 @@ module Bundler Bundler.ui.warn "The validation message from RubyGems was:\n #{e.message}" end + + def extension_cache_path(spec) + nil + end end end end diff --git a/lib/bundler/source/path/installer.rb b/lib/bundler/source/path/installer.rb index 64e63766dd..a0357ffa39 100644 --- a/lib/bundler/source/path/installer.rb +++ b/lib/bundler/source/path/installer.rb @@ -7,6 +7,7 @@ module Bundler attr_reader :spec def initialize(spec, options = {}) + @options = options @spec = spec @gem_dir = Bundler.rubygems.path(spec.full_gem_path) @wrappers = true diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index 70dc5ac038..7939e6db77 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -148,7 +148,8 @@ module Bundler :wrappers => true, :env_shebang => true, :build_args => opts[:build_args], - :bundler_expected_checksum => spec.respond_to?(:checksum) && spec.checksum + :bundler_expected_checksum => spec.respond_to?(:checksum) && spec.checksum, + :bundler_extension_cache_path => extension_cache_path(spec) ).install end spec.full_gem_path = installed_spec.full_gem_path @@ -498,6 +499,11 @@ module Bundler Bundler.user_cache.join("gems", cache_slug, spec.file_name) end + + def extension_cache_path(spec) + return unless download_path = download_cache_path(spec) + download_path.parent.join("extensions", Bundler.ruby_scope, spec.full_name) + end end end end |
