class Bundler::Definition
def converge_sources
def converge_sources changes = false # Get the Rubygems source from the Gemfile.lock locked_gem = @locked_sources.find { |s| s.kind_of?(Source::Rubygems) } # Get the Rubygems source from the Gemfile actual_gem = @sources.find { |s| s.kind_of?(Source::Rubygems) } # If there is a Rubygems source in both if locked_gem && actual_gem # Merge the remotes from the Gemfile into the Gemfile.lock changes = changes | locked_gem.replace_remotes(actual_gem) end # Replace the sources from the Gemfile with the sources from the Gemfile.lock, # if they exist in the Gemfile.lock and are `==`. If you can't find an equivalent # source in the Gemfile.lock, use the one from the Gemfile. @sources.map! do |source| @locked_sources.find { |s| s == source } || source end changes = changes | (Set.new(@sources) != Set.new(@locked_sources)) @sources.each do |source| # If the source is unlockable and the current command allows an unlock of # the source (for example, you are doing a `bundle update <foo>` of a git-pinned # gem), unlock it. For git sources, this means to unlock the revision, which # will cause the `ref` used to be the most recent for the branch (or master) if # an explicit `ref` is not used. if source.respond_to?(:unlock!) && @unlock[:sources].include?(source.name) source.unlock! changes = true end end changes end