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.



153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/rubygems/spec_fetcher.rb', line 153

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

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

  [specs, errors]
end