File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,8 +14,7 @@ def initialize(options, gems)
1414 def run
1515 Bundler . ui . level = "warn" if options [ :quiet ]
1616
17- Bundler ::CLI ::Common . validate_cooldown! ( options [ :cooldown ] )
18- Bundler . settings . set_command_option_if_given :cooldown , options [ :cooldown ]
17+ Bundler ::CLI ::Common . configure_cooldown ( options )
1918
2019 validate_options!
2120 inject_dependencies
Original file line number Diff line number Diff line change 22
33module Bundler
44 module CLI ::Common
5+ # Validates the `--cooldown` flag and makes it the setting for this
6+ # command. Every command that takes the flag goes through here, so they
7+ # share one reading of the value.
8+ def self . configure_cooldown ( options )
9+ value = options [ :cooldown ]
10+
11+ validate_cooldown! ( value )
12+ Bundler . settings . set_command_option_if_given :cooldown , value
13+ end
14+
515 def self . validate_cooldown! ( value )
616 # Without the flag the config file and BUNDLE_COOLDOWN decide, and those
717 # only warn, so a typo left in a config file keeps the command usable.
Original file line number Diff line number Diff line change @@ -115,8 +115,7 @@ def normalize_settings
115115
116116 Bundler . settings . set_command_option_if_given :jobs , options [ "jobs" ]
117117
118- Bundler ::CLI ::Common . validate_cooldown! ( options [ "cooldown" ] )
119- Bundler . settings . set_command_option_if_given :cooldown , options [ "cooldown" ]
118+ Bundler ::CLI ::Common . configure_cooldown ( options )
120119
121120 Bundler . settings . set_command_option_if_given :no_install , options [ "no-install" ]
122121
Original file line number Diff line number Diff line change @@ -16,8 +16,7 @@ def run
1616
1717 check_for_conflicting_options
1818
19- Bundler ::CLI ::Common . validate_cooldown! ( options [ :cooldown ] )
20- Bundler . settings . set_command_option_if_given :cooldown , options [ :cooldown ]
19+ Bundler ::CLI ::Common . configure_cooldown ( options )
2120
2221 print = options [ :print ]
2322 previous_output_stream = Bundler . ui . output_stream
Original file line number Diff line number Diff line change @@ -26,8 +26,7 @@ def initialize(options, gems)
2626 def run
2727 check_for_deployment_mode!
2828
29- Bundler ::CLI ::Common . validate_cooldown! ( options [ :cooldown ] )
30- Bundler . settings . set_command_option_if_given :cooldown , options [ :cooldown ]
29+ Bundler ::CLI ::Common . configure_cooldown ( options )
3130
3231 Bundler . definition . validate_runtime!
3332 current_specs = Bundler . ui . silence { Bundler . definition . resolve }
Original file line number Diff line number Diff line change @@ -74,8 +74,7 @@ def run
7474 opts [ "force" ] = options [ :redownload ] if options [ :redownload ]
7575
7676 Bundler . settings . set_command_option_if_given :jobs , opts [ "jobs" ]
77- Bundler ::CLI ::Common . validate_cooldown! ( options [ :cooldown ] )
78- Bundler . settings . set_command_option_if_given :cooldown , options [ :cooldown ]
77+ Bundler ::CLI ::Common . configure_cooldown ( options )
7978
8079 Bundler . definition . validate_runtime!
8180
You can’t perform that action at this time.
0 commit comments