Class: Suppository::MasterDeb
- Inherits:
-
Object
- Object
- Suppository::MasterDeb
- Defined in:
- lib/suppository/master_deb.rb
Instance Attribute Summary collapse
-
#dirname ⇒ Object
readonly
Returns the value of attribute dirname.
-
#md5sum ⇒ Object
readonly
Returns the value of attribute md5sum.
-
#sha1 ⇒ Object
readonly
Returns the value of attribute sha1.
-
#sha256 ⇒ Object
readonly
Returns the value of attribute sha256.
Instance Method Summary collapse
- #filename ⇒ Object
- #full_attr ⇒ Object
-
#initialize(path) ⇒ MasterDeb
constructor
A new instance of MasterDeb.
- #size ⇒ Object
Constructor Details
#initialize(path) ⇒ MasterDeb
Returns a new instance of MasterDeb.
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/suppository/master_deb.rb', line 8 def initialize(path) @path = path assert_in_suppository checksums = checksums_from_name @md5sum = checksums['md5'] @sha1 = checksums['sha1'] @sha256 = checksums['sha256'] @dirname = File.dirname(path) @attr = Suppository::DpkgDeb.new(path).attibutes end |
Instance Attribute Details
#dirname ⇒ Object (readonly)
Returns the value of attribute dirname.
6 7 8 |
# File 'lib/suppository/master_deb.rb', line 6 def dirname @dirname end |
#md5sum ⇒ Object (readonly)
Returns the value of attribute md5sum.
6 7 8 |
# File 'lib/suppository/master_deb.rb', line 6 def md5sum @md5sum end |
#sha1 ⇒ Object (readonly)
Returns the value of attribute sha1.
6 7 8 |
# File 'lib/suppository/master_deb.rb', line 6 def sha1 @sha1 end |
#sha256 ⇒ Object (readonly)
Returns the value of attribute sha256.
6 7 8 |
# File 'lib/suppository/master_deb.rb', line 6 def sha256 @sha256 end |
Instance Method Details
#filename ⇒ Object
22 23 24 |
# File 'lib/suppository/master_deb.rb', line 22 def filename "#{@attr['Package']}_#{@attr['Version']}_#{@attr['Architecture']}.deb" end |
#full_attr ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/suppository/master_deb.rb', line 26 def full_attr full_attrs = @attr full_attrs['Size'] = size full_attrs['MD5Sum'] = @md5sum full_attrs['SHA1'] = @sha1 full_attrs['SHA256'] = @sha256 full_attrs end |
#size ⇒ Object
35 36 37 |
# File 'lib/suppository/master_deb.rb', line 35 def size File.size(@path) end |