1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[rubygems/rubygems] Centralize with and without setting

https://github.com/rubygems/rubygems/commit/5e854722e2
This commit is contained in:
David Rodríguez 2020-05-28 23:06:34 +02:00 committed by Hiroshi SHIBATA
parent 9422162f71
commit b2a460ea3e
Notes: git 2020-06-05 07:33:58 +09:00

View file

@ -150,20 +150,16 @@ 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] == []
# 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, without
Bundler.settings.set_command_option :with, with
end