Class: YumRepo::PackageChangelog
- Inherits:
-
Object
- Object
- YumRepo::PackageChangelog
- Defined in:
- lib/yumrepo.rb
Constant Summary collapse
- @@version_regex_std =
/(^|\:|\s+|v|r|V|R)(([0-9]+\.){1,10}[a-zA-Z0-9\-]+)/
- @@version_regex_odd =
/(([a-zA-Z0-9\-]+)\-[a-zA-Z0-9\-]{1,10})/
Instance Attribute Summary collapse
-
#arch ⇒ Object
readonly
Returns the value of attribute arch.
-
#current_release ⇒ Object
readonly
Returns the value of attribute current_release.
-
#current_version ⇒ Object
readonly
Returns the value of attribute current_version.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #all ⇒ Object
- #each ⇒ Object
-
#initialize(xml) ⇒ PackageChangelog
constructor
A new instance of PackageChangelog.
Constructor Details
#initialize(xml) ⇒ PackageChangelog
Returns a new instance of PackageChangelog.
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
# File 'lib/yumrepo.rb', line 297 def initialize(xml) doc = Nokogiri::XML(xml) doc.remove_namespaces! @name = doc.xpath('/package/@name').text.strip @arch = doc.xpath('/package/@arch').text.strip @current_version = doc.xpath('/package/version/@ver').text.strip @current_release = doc.xpath('/package/version/@rel').text.strip @releases = doc.xpath('/package/changelog').map do |pr| { :author => pr.at_xpath('./@author').text.strip, :version => _get_version_string(pr.at_xpath('./@author').text), :date => Time.at(pr.at_xpath('./@date').text.strip.to_i), :summary => pr.text.sub(/^- /, '') } end end |
Instance Attribute Details
#arch ⇒ Object (readonly)
Returns the value of attribute arch.
292 293 294 |
# File 'lib/yumrepo.rb', line 292 def arch @arch end |
#current_release ⇒ Object (readonly)
Returns the value of attribute current_release.
292 293 294 |
# File 'lib/yumrepo.rb', line 292 def current_release @current_release end |
#current_version ⇒ Object (readonly)
Returns the value of attribute current_version.
292 293 294 |
# File 'lib/yumrepo.rb', line 292 def current_version @current_version end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
292 293 294 |
# File 'lib/yumrepo.rb', line 292 def name @name end |
Instance Method Details
#all ⇒ Object
321 322 323 |
# File 'lib/yumrepo.rb', line 321 def all @releases end |
#each ⇒ Object
315 316 317 318 319 |
# File 'lib/yumrepo.rb', line 315 def each all.each do |r| yield r end end |