Module: FancyVersion
- Defined in:
- lib/fancy_version.rb,
lib/fancy_version/version.rb,
lib/fancy_version/codename.rb
Defined Under Namespace
Classes: Dictionary
Constant Summary collapse
- VERSION =
"0.0.2"- VERSION_CODENAME =
FancyVersion.codename( VERSION )
- DICTIONARY_EXAMPLE =
class Dictionary
Dictionary.new( %w{zebra ape buffallo cheetah dolphin eagle}, # _Z_ebra for zero %w{newborn young adolescent adult elderly}, %w{silly grumpy horrible} )
- DEFAULTS =
{ :dictionary => DICTIONARY_EXAMPLE, }
Class Method Summary collapse
Class Method Details
.codename(version_str, opts = {}) ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/fancy_version/codename.rb', line 29 def self.codename( version_str, opts = {} ) = DEFAULTS.merge( opts ) major, minor, revision = version_str.split(".") codename = [] codename << [:dictionary].try( :major, major ) codename << [:dictionary].try( :minor, minor ) codename << [:dictionary].try( :revision, revision ) codename.map(&:to_s).map(&:capitalize).reverse.join(' ') end |