summaryrefslogtreecommitdiff
path: root/lib/bundler/source/rubygems.rb
diff options
context:
space:
mode:
-rw-r--r--lib/bundler/source/rubygems.rb24
1 files changed, 20 insertions, 4 deletions
@@ -20,17 +20,29 @@ module Bundler
@dependency_names = []
@allow_remote = false
@allow_cached = false
@caches = [cache_path, *Bundler.rubygems.gem_cache]
- Array(options["remotes"] || []).reverse_each {|r| add_remote(r) }
end
def remote!
@specs = nil
@allow_remote = true
end
def cached!
@specs = nil
@allow_cached = true
end
@@ -49,8 +61,12 @@ module Bundler
o.is_a?(Rubygems) && (o.credless_remotes - credless_remotes).empty?
end
def can_lock?(spec)
- return super if Bundler.feature_flag.disable_multisource?
spec.source.is_a?(Rubygems)
end
@@ -87,7 +103,7 @@ module Bundler
# small_idx.use large_idx.
idx = @allow_remote ? remote_specs.dup : Index.new
idx.use(cached_specs, :override_dupes) if @allow_cached || @allow_remote
- idx.use(installed_specs, :override_dupes)
idx
end
end
@@ -365,7 +381,7 @@ module Bundler
def cached_specs
@cached_specs ||= begin
- idx = installed_specs.dup
Dir["#{cache_path}/*.gem"].each do |gemfile|
next if gemfile =~ /^bundler\-[\d\.]+?\.gem/