Class: EnhanceRepo::RpmMd::DeltaRpm

Inherits:
PackageId
  • Object
show all
Defined in:
lib/enhance_repo/rpm_md/delta_info.rb

Instance Attribute Summary collapse

Attributes inherited from PackageId

#checksum, #path, #rpm

Instance Method Summary collapse

Methods inherited from PackageId

#ident, #matches, #method_missing, #to_s

Constructor Details

#initialize(filename) ⇒ DeltaRpm

Returns a new instance of DeltaRpm.



41
42
43
44
45
46
47
48
49
# File 'lib/enhance_repo/rpm_md/delta_info.rb', line 41

def initialize(filename)
  super(filename)
  `applydeltarpm -i '#{filename}'`.each_line do |line|
    key, value = line.chop.split(':')
    value.gsub!(/ /, '')
    @sequence = value if key == "sequence"
    @sourcerpm = value if key == "source rpm"
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class EnhanceRepo::PackageId

Instance Attribute Details

#sequenceObject

Returns the value of attribute sequence.



39
40
41
# File 'lib/enhance_repo/rpm_md/delta_info.rb', line 39

def sequence
  @sequence
end

#sourcerpmObject

Returns the value of attribute sourcerpm.



39
40
41
# File 'lib/enhance_repo/rpm_md/delta_info.rb', line 39

def sourcerpm
  @sourcerpm
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/enhance_repo/rpm_md/delta_info.rb', line 55

def eql?(other)
  ident == other.ident
end

#hashObject



51
52
53
# File 'lib/enhance_repo/rpm_md/delta_info.rb', line 51

def hash
  ident.hash
end