From be7b5929126cb3e696ef222339237faba9b8fe5a Mon Sep 17 00:00:00 2001 From: hsbt Date: Wed, 1 Nov 2017 23:29:38 +0000 Subject: Update bundled bundler to 1.16.0. * lib/bundler, spec/bundler: Merge bundler-1.16.0. * common.mk: rspec examples of bundler-1.16.0 needs require option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/bundler/plugin/api/source.rb | 11 +++++++++-- lib/bundler/plugin/installer.rb | 13 +++++++------ lib/bundler/plugin/source_list.rb | 15 +++++++-------- 3 files changed, 23 insertions(+), 16 deletions(-) (limited to 'lib/bundler/plugin') diff --git a/lib/bundler/plugin/api/source.rb b/lib/bundler/plugin/api/source.rb index 5d3f58df92..586477efb5 100644 --- a/lib/bundler/plugin/api/source.rb +++ b/lib/bundler/plugin/api/source.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true + require "uri" -require "digest/sha1" module Bundler module Plugin @@ -271,7 +271,7 @@ module Bundler end def uri_hash - Digest::SHA1.hexdigest(uri) + SharedHelpers.digest(:SHA1).hexdigest(uri) end # Note: Do not override if you don't know what you are doing. @@ -293,6 +293,13 @@ module Bundler def bundler_plugin_api_source? true end + + # @private + # This API on source might not be stable, and for now we expect plugins + # to download all specs in `#specs`, so we implement the method for + # compatibility purposes and leave it undocumented (and don't support) + # overriding it) + def double_check_for(*); end end end end diff --git a/lib/bundler/plugin/installer.rb b/lib/bundler/plugin/installer.rb index a50d0ceedd..5379c38979 100644 --- a/lib/bundler/plugin/installer.rb +++ b/lib/bundler/plugin/installer.rb @@ -13,12 +13,13 @@ module Bundler def install(names, options) version = options[:version] || [">= 0"] - - if options[:git] - install_git(names, version, options) - else - sources = options[:source] || Bundler.rubygems.sources - install_rubygems(names, version, sources) + Bundler.settings.temporary(:lockfile_uses_separate_rubygems_sources => false, :disable_multisource => false) do + if options[:git] + install_git(names, version, options) + else + sources = options[:source] || Bundler.rubygems.sources + install_rubygems(names, version, sources) + end end end diff --git a/lib/bundler/plugin/source_list.rb b/lib/bundler/plugin/source_list.rb index 33f5e5afbd..f0e212205f 100644 --- a/lib/bundler/plugin/source_list.rb +++ b/lib/bundler/plugin/source_list.rb @@ -5,13 +5,6 @@ module Bundler # approptiate options to be used with Source classes for plugin installation module Plugin class SourceList < Bundler::SourceList - def initialize - @path_sources = [] - @git_sources = [] - @rubygems_aggregate = Plugin::Installer::Rubygems.new - @rubygems_sources = [] - end - def add_git_source(options = {}) add_source_to_list Plugin::Installer::Git.new(options), git_sources end @@ -21,7 +14,13 @@ module Bundler end def all_sources - path_sources + git_sources + rubygems_sources + path_sources + git_sources + rubygems_sources + [metadata_source] + end + + private + + def rubygems_aggregate_class + Plugin::Installer::Rubygems end end end -- cgit v1.2.3