Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Gem::Commands::OutdatedCommand#partition_by_cooldown
partition_by_cooldown(spec_tuples)
lib/rubygems/commands/outdated_command.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/rubygems/commands/outdated_command.rb, line 86
def partition_by_cooldown(spec_tuples)
selectable = []
embargoed = []
with_times = spec_tuples.map do |tup, source|
[tup, source, source.created_at_for_tuple(tup)]
end
if !with_times.empty? && with_times.none? {|_, _, created_at| created_at }
Gem::Cooldown.warn_missing_created_at with_times.first[1]
end
with_times.each do |tup, _, created_at|
if @cooldown.skip?(created_at)
embargoed << tup.version
else
selectable << tup.version
end
end
[selectable, embargoed]
end
Splits [NameTuple, Gem::Source] pairs into versions outside and within the cooldown period. Tuples with an unknown publish time count as outside the period, so the cooldown fails open.