Class: Captain::PackageList::ComponentManifest

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/captain/package_list.rb

Instance Method Summary collapse

Constructor Details

#initialize(mirror, codename, component, architecture) ⇒ ComponentManifest

Returns a new instance of ComponentManifest.



73
74
75
76
77
78
# File 'lib/captain/package_list.rb', line 73

def initialize(mirror, codename, component, architecture)
  @mirror       = mirror
  @codename     = codename
  @component    = component
  @architecture = architecture
end

Instance Method Details

#eachObject



80
81
82
83
84
85
86
87
88
89
90
# File 'lib/captain/package_list.rb', line 80

def each
  buffer = []
  open_stream.each_line do |line|
    if line == "\n"
      yield Package.new(@mirror, @codename, @component, buffer.join)
      buffer.clear
    else
      buffer.push(line)
    end
  end
end