End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Gem::Specification.outdated_and_latest_version
outdated_and_latest_version() { |local_spec, latest_remote| ... }
lib/rubygems/specification.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/rubygems/specification.rb, line 1192
def self.outdated_and_latest_version
return enum_for __method__ unless block_given?
# TODO: maybe we should switch to rubygems' version service?
fetcher = Gem::SpecFetcher.fetcher
latest_specs(true).each do |local_spec|
dependency =
Gem::Dependency.new local_spec.name, ">= #{local_spec.version}"
remotes, = fetcher.search_for_dependency dependency
remotes = remotes.map {|n, _| n.version }
latest_remote = remotes.sort.last
yield [local_spec, latest_remote] if
latest_remote and local_spec.version < latest_remote
end
nil
end
Enumerates the outdated local gems yielding the local specification and the latest remote version.
This method may take some time to return as it must check each local gem against the server’s index.
See also
.outdated
.required_attribute?
.normalize_yaml_input
.required_attributes
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1