Class: YumRepo::PackageChangelogList

Inherits:
Object
  • Object
show all
Defined in:
lib/yumrepo.rb

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ PackageChangelogList

Returns a new instance of PackageChangelogList.



259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/yumrepo.rb', line 259

def initialize(url)
  @url = url
  @xml_file = Repomd.new(url).other
  @changelogs = []

  buf = ''
  YumRepo.bench("Zlib::GzipReader.read") do
    buf = Zlib::GzipReader.new(@xml_file).read
  end

  YumRepo.bench("Building PackageChangelog Objects") do
    d = Nokogiri::XML::Reader(buf)
    d.each do |n|
      if n.name == 'package' and not n.node_type == Nokogiri::XML::Reader::TYPE_END_ELEMENT
        @changelogs << PackageChangelog.new(n.outer_xml)
      end
    end
  end
end

Instance Method Details

#allObject



285
286
287
# File 'lib/yumrepo.rb', line 285

def all
  @changelogs
end

#eachObject



279
280
281
282
283
# File 'lib/yumrepo.rb', line 279

def each
  all.each do |p|
    yield p
  end
end