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-4.0.0/lib/rubygems/specification.rb, line 1144
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 && 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
.remove_spec
.normalize_yaml_input
.required_attribute?
also in
4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0