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

#arch, #ident, #matches, #method_missing, #to_s

Methods included from Logger

#log

Constructor Details

#initialize(filename) ⇒ DeltaRpm

Returns a new instance of DeltaRpm.



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

def initialize(filename)
  super(filename)
  `applydeltarpm -i '#{filename}'`.each_line do |line|
    key, value = line.chop.split(':')
    value.delete!(' ')
    @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.



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

def sequence
  @sequence
end

#sourcerpmObject

Returns the value of attribute sourcerpm.



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

def sourcerpm
  @sourcerpm
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#hashObject



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

def hash
  ident.hash
end