method
outdated_and_latest_version
v2_2_9 -
Show latest stable
- Class:
Gem::Specification
outdated_and_latest_version()public
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.
# File lib/rubygems/specification.rb, line 1100
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 Related methods
- Instance methods
- <=>
- ==
- _dump
- activate
- activate_dependencies
- add_bindir
- add_dependency
- add_development_dependency
- add_runtime_dependency
- add_self_to_load_path
- author
- author=
- authors
- authors=
- bin_dir
- bin_file
- build_args
- build_extensions
- build_info_dir
- build_info_file
- bundled_gem_in_old_ruby?
- cache_dir
- cache_file
- conflicts
- date
- date=
- default_executable
- default_value
- dependencies
- dependent_gems
- dependent_specs
- description=
- development_dependencies
- doc_dir
- encode_with
- eql?
- executable
- executable=
- executables
- executables=
- extensions
- extensions=
- extra_rdoc_files
- extra_rdoc_files=
- file_name
- files
- files=
- for_cache
- full_name
- gem_build_complete_path
- gem_dir
- has_rdoc
- has_rdoc=
- has_rdoc?
- has_unit_tests?
- hash
- init_with
- initialize_copy
- inspect
- installed_by_version
- installed_by_version=
- lib_dirs_glob
- lib_files
- license
- license=
- licenses
- licenses=
- loaded_from=
- mark_version
- matches_for_glob
- method_missing
- missing_extensions?
- name_tuple
- normalize
- original_name
- original_platform
- platform
- platform=
- pretty_print
- raise_if_conflicts
- rdoc_options
- rdoc_options=
- require_path
- require_path=
- require_paths=
- required_ruby_version=
- required_rubygems_version=
- requirements
- requirements=
- reset_nil_attributes_to_default
- respond_to_missing?
- ri_dir
- runtime_dependencies
- satisfies_requirement?
- sort_obj
- source
- spec_dir
- spec_file
- spec_name
- stubbed?
- summary=
- test_file
- test_file=
- test_files
- test_files=
- to_ruby
- to_ruby_for_cache
- to_s
- to_spec
- to_yaml
- traverse
- validate
- validate_dependencies
- validate_permissions
- version=
- warning
- yaml_initialize
- Class methods
- _all
- _clear_load_cache
- _load
- _resort!
- add_spec
- add_specs
- all
- all=
- all_names
- array_attributes
- attribute_names
- dirs
- dirs=
- each
- each_gemspec
- each_spec
- each_stub
- find_all_by_name
- find_by_name
- find_by_path
- find_in_unresolved
- find_in_unresolved_tree
- find_inactive_by_path
- from_yaml
- latest_specs
- load
- load_defaults
- new
- non_nil_attributes
- normalize_yaml_input
- outdated
- outdated_and_latest_version
- remove_spec
- required_attribute?
- required_attributes
- reset
- stubs
- unresolved_deps
- Private methods
-
add_dependency_with_type -
check_version_conflict -
find_all_satisfiers -
find_full_gem_path -
invalidate_memoized_attributes -
ruby_code -
same_attributes?