Sha256: 79857f51dc7ea8d16e732489646453d7e35e70cee4d8ee43d5603a5e1b0b5c78

Contents?: true

Size: 612 Bytes

Versions: 4

Compression:

Stored size: 612 Bytes

Contents

require 'delegate'
require 'ostruct'

module Gem2Rpm
  class SpecFetcher < SimpleDelegator
    # Find and fetch specs that match +dependency+.
    #
    # If +matching_platform+ is false, gems for all platforms are returned.
    def spec_for_dependency(dependency, matching_platform = true)
      super
    rescue
      errors = []

      begin
        spec, source = find_matching(dependency, true, matching_platform).first
      rescue Gem::Exception => e
        errors << OpenStruct.new(:error => e)
      end

      source = OpenStruct.new(:uri => source)
      [[[spec, source]], errors]
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gem2rpm-1.0.2 lib/gem2rpm/gem/spec_fetcher.rb
gem2rpm-1.0.1 lib/gem2rpm/gem/spec_fetcher.rb
gem2rpm-1.0.0 lib/gem2rpm/gem/spec_fetcher.rb
gem2rpm-0.11.3 lib/gem2rpm/spec_fetcher.rb