Class: Debsacker::Package::Version
- Inherits:
-
Object
- Object
- Debsacker::Package::Version
- Defined in:
- lib/debsacker/package/version.rb
Instance Attribute Summary collapse
-
#add_branch ⇒ Object
Returns the value of attribute add_branch.
-
#add_distro ⇒ Object
Returns the value of attribute add_distro.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(version_type) ⇒ Version
constructor
A new instance of Version.
Constructor Details
#initialize(version_type) ⇒ Version
Returns a new instance of Version.
8 9 10 |
# File 'lib/debsacker/package/version.rb', line 8 def initialize(version_type) @version_type = version_type end |
Instance Attribute Details
#add_branch ⇒ Object
Returns the value of attribute add_branch.
6 7 8 |
# File 'lib/debsacker/package/version.rb', line 6 def add_branch @add_branch end |
#add_distro ⇒ Object
Returns the value of attribute add_distro.
6 7 8 |
# File 'lib/debsacker/package/version.rb', line 6 def add_distro @add_distro end |
Instance Method Details
#generate ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/debsacker/package/version.rb', line 12 def generate begin case @version_type when 'tag', nil version = tag when 'commit' version = commit when 'datetime' version = datetime else version = @version_type end rescue version = '0.1.0' end version << "-#{ branch_name }" if add_branch version << "-#{ distro_name }" if add_distro version end |