Class: YumRepo::PackageChangelogList
- Inherits:
-
Object
- Object
- YumRepo::PackageChangelogList
- Defined in:
- lib/yumrepo.rb
Instance Method Summary collapse
- #all ⇒ Object
- #each ⇒ Object
-
#initialize(url) ⇒ PackageChangelogList
constructor
A new instance of PackageChangelogList.
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
#all ⇒ Object
285 286 287 |
# File 'lib/yumrepo.rb', line 285 def all @changelogs end |
#each ⇒ Object
279 280 281 282 283 |
# File 'lib/yumrepo.rb', line 279 def each all.each do |p| yield p end end |