Class: RightPublish::ZyppRepo::Package

Inherits:
Object
  • Object
show all
Defined in:
lib/right_publish/repos/zypp.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#archObject (readonly)

Returns the value of attribute arch.



20
21
22
# File 'lib/right_publish/repos/zypp.rb', line 20

def arch
  @arch
end

#checksumObject (readonly)

Returns the value of attribute checksum.



18
19
20
# File 'lib/right_publish/repos/zypp.rb', line 18

def checksum
  @checksum
end

#nameObject (readonly)

Returns the value of attribute name.



19
20
21
# File 'lib/right_publish/repos/zypp.rb', line 19

def name
  @name
end

#relObject (readonly)

Returns the value of attribute rel.



22
23
24
# File 'lib/right_publish/repos/zypp.rb', line 22

def rel
  @rel
end

#verObject (readonly)

Returns the value of attribute ver.



21
22
23
# File 'lib/right_publish/repos/zypp.rb', line 21

def ver
  @ver
end