Class: Babushka::SystemDefinition
- Defined in:
- lib/babushka/system_definition.rb
Constant Summary collapse
- CODENAMES =
{ :osx => { :osx => { '10.3' => :panther, '10.4' => :tiger, '10.5' => :leopard, '10.6' => :snow_leopard, '10.7' => :lion, '10.8' => :mountain_lion, '10.9' => :mavericks, '10.10' => :yosemite, } }, :linux => { :ubuntu => { '4.10' => :warty, '5.04' => :hoary, '5.10' => :breezy, '6.06' => :dapper, '6.10' => :edgy, '7.04' => :feisty, '7.10' => :gutsy, '8.04' => :hardy, '8.10' => :intrepid, '9.04' => :jaunty, '9.10' => :karmic, '10.04' => :lucid, '10.10' => :maverick, '11.04' => :natty, '11.10' => :oneiric, '12.04' => :precise, '12.10' => :quantal, '13.04' => :raring, '13.10' => :saucy, '14.04' => :trusty, '14.10' => :utopic, '15.04' => :vivid, '15.10' => :wily, '16.04' => :xenial, '17.10' => :artful, '18.04' => :bionic, }, :debian => { '4' => :etch, '5' => :lenny, '6' => :squeeze, '7' => :wheezy, '8' => :jessie, '9' => :stretch, '10' => :buster, }, :redhat => { '3' => :taroon, '4' => :nahant, '5' => :tikanga, '6' => :santiago, }, :fedora => { '14' => :laughlin, '15' => :lovelock, '16' => :verne, '17' => :beefy, '18' => :spherical, '19' => :schrodinger, }, :opensuse => { '13.1' => :bottle, '13.2' => :harlequin, }, :arch => {}, }, :bsd => { :dragonfly => {}, :freebsd => {}, }, }
- DESCRIPTIONS =
{ :osx => { :osx => { '10.3' => 'Panther', '10.4' => 'Tiger', '10.5' => 'Leopard', '10.6' => 'Snow Leopard', '10.7' => 'Lion', '10.8' => 'Mountain Lion', '10.9' => 'Mavericks', } }, :linux => { :ubuntu => { '4.10' => 'Warty Warthog', '5.04' => 'Hoary Hedgehog', '5.10' => 'Breezy Badger', '6.06' => 'Dapper Drake', '6.10' => 'Edgy Eft', '7.04' => 'Feisty Fawn', '7.10' => 'Gutsy Gibbon', '8.04' => 'Hardy Heron', '8.10' => 'Intrepid Ibex', '9.04' => 'Jaunty Jackalope', '9.10' => 'Karmic Koala', '10.04' => 'Lucid Lynx', '10.10' => 'Maverick Meerkat', '11.04' => 'Natty Narwhal', '11.10' => 'Oneiric Ocelot', '12.04' => 'Precise Pangolin', '12.10' => 'Quantal Quetzal', '13.04' => 'Raring Ringtail', '13.10' => 'Saucy Salamander', '14.04' => 'Trusty Tahr', '14.10' => 'Utopic Unicorn', '15.04' => 'Vivid Vervet', '15.10' => 'Wily Werewolf', '16.04' => 'Xenial Xerus', '17.10' => 'Artful Aardvark', '18.04' => 'Bionic Beaver', }, :redhat => { '3' => 'Taroon', '4' => 'Nahant', '5' => 'Tikanga', '6' => 'Santiago', }, :fedora => { '14' => 'Laughlin', '15' => 'Lovelock', '16' => 'Verne', '17' => 'Beefy Miracle', '18' => 'Spherical Cow', '19' => "Schrödinger's Cat", }, :opensuse => { '13.1' => 'Bottle', '13.2' => 'Harlequin', }, }, :bsd => { :dragonfly => {}, :freebsd => {}, }, }
Instance Attribute Summary collapse
-
#flavour ⇒ Object
readonly
Returns the value of attribute flavour.
-
#release ⇒ Object
readonly
Returns the value of attribute release.
-
#system ⇒ Object
readonly
Returns the value of attribute system.
Class Method Summary collapse
Instance Method Summary collapse
- #codename ⇒ Object
- #codename_str ⇒ Object
-
#initialize(system, flavour, release) ⇒ SystemDefinition
constructor
A new instance of SystemDefinition.
Constructor Details
#initialize(system, flavour, release) ⇒ SystemDefinition
Returns a new instance of SystemDefinition.
24 25 26 |
# File 'lib/babushka/system_definition.rb', line 24 def initialize system, flavour, release @system, @flavour, @release = system, flavour, release end |
Instance Attribute Details
#flavour ⇒ Object (readonly)
Returns the value of attribute flavour.
22 23 24 |
# File 'lib/babushka/system_definition.rb', line 22 def flavour @flavour end |
#release ⇒ Object (readonly)
Returns the value of attribute release.
22 23 24 |
# File 'lib/babushka/system_definition.rb', line 22 def release @release end |
#system ⇒ Object (readonly)
Returns the value of attribute system.
22 23 24 |
# File 'lib/babushka/system_definition.rb', line 22 def system @system end |
Class Method Details
.all_flavours ⇒ Object
10 11 12 |
# File 'lib/babushka/system_definition.rb', line 10 def self.all_flavours CODENAMES.values.map(&:keys).flatten end |
.all_names ⇒ Object
14 15 16 |
# File 'lib/babushka/system_definition.rb', line 14 def self.all_names CODENAMES.values.map(&:values).map {|s| s.map(&:values) }.flatten end |
.all_systems ⇒ Object
6 7 8 |
# File 'lib/babushka/system_definition.rb', line 6 def self.all_systems CODENAMES.keys end |
.all_tokens ⇒ Object
18 19 20 |
# File 'lib/babushka/system_definition.rb', line 18 def self.all_tokens all_systems + PkgHelper.all_manager_keys + all_flavours + all_names end |
Instance Method Details
#codename ⇒ Object
28 29 30 |
# File 'lib/babushka/system_definition.rb', line 28 def codename (CODENAMES[system][flavour] || {})[release] end |
#codename_str ⇒ Object
32 33 34 |
# File 'lib/babushka/system_definition.rb', line 32 def codename_str (DESCRIPTIONS[system][flavour] || {})[release] end |