Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Gem::CooldownOption#add_cooldown_option
add_cooldown_option(group = nil)
lib/rubygems/cooldown_option.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/rubygems/cooldown_option.rb, line 12
def add_cooldown_option(group = nil)
args = [group, "--cooldown DAYS", Integer,
"Do not use gem versions published within",
"the last DAYS days (0 disables the cooldown,",
"overriding the gemrc and Bundler settings)"].compact
add_option(*args) do |value, options|
if value.negative?
raise Gem::OptionParser::InvalidArgument,
"#{value} (expected a non-negative integer number of days; use 0 to disable the cooldown)"
end
options[:cooldown] = value
end
end
Add the –cooldown option to the option parser.