Class: Sparrowhawk::GemMapper

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/sparrowhawk/gem_mapper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gems) ⇒ GemMapper


8
9
10
# File 'lib/sparrowhawk/gem_mapper.rb', line 8

def initialize gems
  @gems = gems
end

Instance Attribute Details

#gemsObject (readonly)

Returns the value of attribute gems


6
7
8
# File 'lib/sparrowhawk/gem_mapper.rb', line 6

def gems
  @gems
end

Instance Method Details

#eachObject


12
13
14
15
16
17
18
19
20
21
# File 'lib/sparrowhawk/gem_mapper.rb', line 12

def each
  gems.each do |gem|
    spec = gem.spec
    yield spec_entry spec.spec_name, spec.to_ruby

    gem.file_entries.each do |file_entry|
      yield gem_file_entry spec.full_name, file_entry[0]["path"], file_entry[1]
    end
  end
end