Skip to content

Commit

Permalink
Centralize with and without setting
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed May 31, 2020
1 parent 365b463 commit 5e85472
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions bundler/lib/bundler/cli/install.rb
Expand Up @@ -150,20 +150,16 @@ def normalize_groups

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
Expand Down

0 comments on commit 5e85472

Please sign in to comment.