summaryrefslogtreecommitdiff
path: root/lib/bundler
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2020-12-18 12:13:33 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-12-18 13:33:18 +0900
commit0e40cc9b194a5e46024d32b85a61e651372a65cb (patch)
treed91f781ca34d78897d8cea9fb3403e47f891df5a /lib/bundler
parent34f06062174882a98ebef998c50ad8d4f7fc0f2e (diff)
Merge RubyGems 3.2.2 and Bundler 2.2.2
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3930
Diffstat (limited to 'lib/bundler')
-rw-r--r--lib/bundler/cli/install.rb19
-rw-r--r--lib/bundler/resolver.rb2
-rw-r--r--lib/bundler/version.rb2
3 files changed, 17 insertions, 6 deletions
diff --git a/lib/bundler/cli/install.rb b/lib/bundler/cli/install.rb
index edf86fe1ba..c702eb14d1 100644
--- a/lib/bundler/cli/install.rb
+++ b/lib/bundler/cli/install.rb
@@ -152,18 +152,27 @@ module Bundler
check_for_group_conflicts_in_cli_options
+ Bundler.settings.set_command_option :with, nil if options[:with] == []
+ Bundler.settings.set_command_option :without, nil if options[:without] == []
+
with = options.fetch(:with, [])
with |= Bundler.settings[:with].map(&:to_s)
with -= options[:without] if options[:without]
- with = nil if options[:with] == []
without = options.fetch(:without, [])
without |= Bundler.settings[:without].map(&:to_s)
without -= options[:with] if options[:with]
- without = nil if options[:without] == []
- Bundler.settings.set_command_option :without, without
- Bundler.settings.set_command_option :with, with
+ options[:with] = with
+ options[:without] = without
+
+ unless Bundler.settings[:without] == options[:without] && Bundler.settings[:with] == options[:with]
+ # need to nil them out first to get around validation for backwards compatibility
+ Bundler.settings.set_command_option :without, nil
+ Bundler.settings.set_command_option :with, nil
+ Bundler.settings.set_command_option :without, options[:without] - options[:with]
+ Bundler.settings.set_command_option :with, options[:with]
+ end
end
def normalize_settings
@@ -190,7 +199,7 @@ module Bundler
Bundler.settings.set_command_option_if_given :clean, options["clean"]
- normalize_groups if options[:without] || options[:with]
+ normalize_groups
options[:force] = options[:redownload]
end
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb
index 4bbcbd1162..636dc8af46 100644
--- a/lib/bundler/resolver.rb
+++ b/lib/bundler/resolver.rb
@@ -155,6 +155,8 @@ module Bundler
search.each do |sg|
next unless sg.for?(platform)
sg_all_platforms = sg.copy_for(self.class.sort_platforms(@platforms).reverse)
+ next unless sg_all_platforms
+
selected_sgs << sg_all_platforms
next if sg_all_platforms.activated_platforms == [Gem::Platform::RUBY]
diff --git a/lib/bundler/version.rb b/lib/bundler/version.rb
index b8b331d85e..c730934258 100644
--- a/lib/bundler/version.rb
+++ b/lib/bundler/version.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: false
module Bundler
- VERSION = "2.2.1".freeze
+ VERSION = "2.2.2".freeze
def self.bundler_major_version
@bundler_major_version ||= VERSION.split(".").first.to_i