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.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/suppository/master_deb.rb', line 10 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.
8 9 10 |
# File 'lib/suppository/master_deb.rb', line 8 def dirname @dirname end |
#md5sum ⇒ Object (readonly)
Returns the value of attribute md5sum.
8 9 10 |
# File 'lib/suppository/master_deb.rb', line 8 def md5sum @md5sum end |
#sha1 ⇒ Object (readonly)
Returns the value of attribute sha1.
8 9 10 |
# File 'lib/suppository/master_deb.rb', line 8 def sha1 @sha1 end |
#sha256 ⇒ Object (readonly)
Returns the value of attribute sha256.
8 9 10 |
# File 'lib/suppository/master_deb.rb', line 8 def sha256 @sha256 end |
Instance Method Details
#filename ⇒ Object
24 25 26 |
# File 'lib/suppository/master_deb.rb', line 24 def filename "#{@attr['Package']}_#{@attr['Version']}_#{@attr['Architecture']}.deb" end |
#full_attr ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/suppository/master_deb.rb', line 28 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
37 38 39 |
# File 'lib/suppository/master_deb.rb', line 37 def size File.size(@path) end |