Method: Gem::SpecFetcher#spec_for_dependency

Defined in:
lib/rubygems/spec_fetcher.rb

#spec_for_dependency(dependency, matching_platform = true) ⇒ Object

Find and fetch specs that match dependency.

If matching_platform is false, gems for all platforms are returned.


166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/rubygems/spec_fetcher.rb', line 166

def spec_for_dependency(dependency, matching_platform=true)
  tuples, errors = search_for_dependency(dependency, matching_platform)

  specs = []
  tuples.each do |tup, source|
    begin
      spec = source.fetch_spec(tup)
    rescue Gem::RemoteFetcher::FetchError => e
      errors << Gem::SourceFetchProblem.new(source, e)
    else
      specs << [spec, source]
    end
  end

  return [specs, errors]
end