Class: RightPublish::ZyppRepo::Package
- Inherits:
-
Object
- Object
- RightPublish::ZyppRepo::Package
- Defined in:
- lib/right_publish/repos/zypp.rb
Instance Attribute Summary collapse
-
#arch ⇒ Object
readonly
Returns the value of attribute arch.
-
#checksum ⇒ Object
readonly
Returns the value of attribute checksum.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#rel ⇒ Object
readonly
Returns the value of attribute rel.
-
#ver ⇒ Object
readonly
Returns the value of attribute ver.
Instance Method Summary collapse
-
#initialize(rpmfile) ⇒ Package
constructor
A new instance of Package.
Constructor Details
#initialize(rpmfile) ⇒ Package
Returns a new instance of Package.
24 25 26 27 28 29 30 |
# File 'lib/right_publish/repos/zypp.rb', line 24 def initialize(rpmfile) @checksum = Digest::SHA1.hexdigest(File.new(rpmfile).read) rpm = File.basename(rpmfile, ".rpm") rpm, _, @arch = rpm.rpartition(".") rpm, _,@rel = rpm.rpartition("-") @name, _,@ver = rpm.rpartition("-") end |
Instance Attribute Details
#arch ⇒ Object (readonly)
Returns the value of attribute arch.
20 21 22 |
# File 'lib/right_publish/repos/zypp.rb', line 20 def arch @arch end |
#checksum ⇒ Object (readonly)
Returns the value of attribute checksum.
18 19 20 |
# File 'lib/right_publish/repos/zypp.rb', line 18 def checksum @checksum end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
19 20 21 |
# File 'lib/right_publish/repos/zypp.rb', line 19 def name @name end |
#rel ⇒ Object (readonly)
Returns the value of attribute rel.
22 23 24 |
# File 'lib/right_publish/repos/zypp.rb', line 22 def rel @rel end |
#ver ⇒ Object (readonly)
Returns the value of attribute ver.
21 22 23 |
# File 'lib/right_publish/repos/zypp.rb', line 21 def ver @ver end |