method

latest_spec_for

Importance_0
v1_9_3_392 - Show latest stable - 0 notes - Class: Gem
latest_spec_for(name) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rubygems.rb, line 931
  def self.latest_spec_for name
    dependency  = Gem::Dependency.new name
    fetcher     = Gem::SpecFetcher.fetcher
    spec_tuples = fetcher.find_matching dependency

    match = spec_tuples.select { |(n, _, p), _|
      n == name and Gem::Platform.match p
    }.sort_by { |(_, version, _), _|
      version
    }.last

    match and fetcher.fetch_spec(*match)
  end
Register or log in to add new notes.