summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/self_manager.rb2
-rw-r--r--lib/bundler/source/rubygems.rb4
-rw-r--r--lib/bundler/source_list.rb4
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/bundler/self_manager.rb b/lib/bundler/self_manager.rb
index 5accda4bcb..bfd000b1a0 100644
--- a/lib/bundler/self_manager.rb
+++ b/lib/bundler/self_manager.rb
@@ -113,7 +113,7 @@ module Bundler
end
def local_specs
- @local_specs ||= Bundler::Source::Rubygems.new("allow_local" => true).specs.select {|spec| spec.name == "bundler" }
+ @local_specs ||= Bundler::Source::Rubygems.new("allow_local" => true, "allow_cached" => true).specs.select {|spec| spec.name == "bundler" }
end
def remote_specs
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index 861aa8bbeb..04cfc0a850 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -17,7 +17,7 @@ module Bundler
@remotes = []
@dependency_names = []
@allow_remote = false
- @allow_cached = false
+ @allow_cached = options["allow_cached"] || false
@allow_local = options["allow_local"] || false
@checksum_store = Checksum::Store.new
@@ -133,7 +133,7 @@ module Bundler
# sources, and large_idx.merge! small_idx is way faster than
# small_idx.merge! large_idx.
index = @allow_remote ? remote_specs.dup : Index.new
- index.merge!(cached_specs) if @allow_cached || @allow_remote
+ index.merge!(cached_specs) if @allow_cached
index.merge!(installed_specs) if @allow_local
index
end
diff --git a/lib/bundler/source_list.rb b/lib/bundler/source_list.rb
index 4419695b7f..d85e1c1c01 100644
--- a/lib/bundler/source_list.rb
+++ b/lib/bundler/source_list.rb
@@ -9,7 +9,7 @@ module Bundler
:metadata_source
def global_rubygems_source
- @global_rubygems_source ||= rubygems_aggregate_class.new("allow_local" => true)
+ @global_rubygems_source ||= rubygems_aggregate_class.new("allow_local" => true, "allow_cached" => true)
end
def initialize
@@ -174,7 +174,7 @@ module Bundler
replacement_source = replacement_sources.find {|s| s == global_rubygems_source }
return global_rubygems_source unless replacement_source
- replacement_source.local!
+ replacement_source.cached!
replacement_source
end