Class: Pione::Package::PackageFilename
- Inherits:
-
StructX
- Object
- StructX
- Pione::Package::PackageFilename
- Defined in:
- lib/pione/package/package-filename.rb
Class Method Summary collapse
-
.parse(str) ⇒ Object
Parse the filename.
Instance Method Summary collapse
- #string(ext = true) ⇒ Object (also: #to_s)
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 |