Class: Pione::Package::PackageFilename

Inherits:
StructX
  • Object
show all
Defined in:
lib/pione/package/package-filename.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(str) ⇒ Object

Parse the filename.



23
24
25
26
27
28
29
# File 'lib/pione/package/package-filename.rb', line 23

def parse(str)
  begin
    new(PackageFilenameParser.new.parse(str))
  rescue => e
    raise InvalidPackageFilename.new(str, e)
  end
end

Instance Method Details

#string(ext = true) ⇒ Object Also known as: to_s



32
33
34
35
36
37
38
39
40
# File 'lib/pione/package/package-filename.rb', line 32

def string(ext=true)
  name = ""
  name << package_name
  name << "(%s)" % editor if editor and editor != "origin"
  name << "+%s" % tag if tag
  name << "@%s" % digest if digest
  name << ".ppg" if ext
  return name
end