Class: FPM::Cookery::Facts
- Inherits:
-
Object
- Object
- FPM::Cookery::Facts
- Defined in:
- lib/fpm/cookery/facts.rb
Class Method Summary collapse
- .arch ⇒ Object
- .lsbcodename ⇒ Object
- .osfamily ⇒ Object
- .osfamily=(value) ⇒ Object
- .osmajorrelease ⇒ Object
- .osrelease ⇒ Object
- .platform ⇒ Object
- .platform=(value) ⇒ Object
- .reset! ⇒ Object
- .target ⇒ Object
- .target=(value) ⇒ Object
Class Method Details
.arch ⇒ Object
7 8 9 |
# File 'lib/fpm/cookery/facts.rb', line 7 def arch @arch ||= value(:architecture) end |
.lsbcodename ⇒ Object
23 24 25 |
# File 'lib/fpm/cookery/facts.rb', line 23 def lsbcodename @lsbcodename ||= value(:lsbcodename) || value(:lsbdistcodename) end |
.osfamily ⇒ Object
31 32 33 |
# File 'lib/fpm/cookery/facts.rb', line 31 def osfamily @osfamily ||= value(:osfamily) end |
.osfamily=(value) ⇒ Object
35 36 37 |
# File 'lib/fpm/cookery/facts.rb', line 35 def osfamily=(value) @osfamily = value.downcase.to_sym end |
.osmajorrelease ⇒ Object
27 28 29 |
# File 'lib/fpm/cookery/facts.rb', line 27 def osmajorrelease @osmajorrelease ||= value(:operatingsystemmajrelease, false) end |
.osrelease ⇒ Object
19 20 21 |
# File 'lib/fpm/cookery/facts.rb', line 19 def osrelease @osrelease ||= value(:operatingsystemrelease, false) end |
.platform ⇒ Object
11 12 13 |
# File 'lib/fpm/cookery/facts.rb', line 11 def platform @platform ||= value(:operatingsystem) end |
.platform=(value) ⇒ Object
15 16 17 |
# File 'lib/fpm/cookery/facts.rb', line 15 def platform=(value) @platform = value.downcase.to_sym end |
.reset! ⇒ Object
52 53 54 |
# File 'lib/fpm/cookery/facts.rb', line 52 def reset! instance_variables.each {|v| instance_variable_set(v, nil) } end |
.target ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'lib/fpm/cookery/facts.rb', line 39 def target @target ||= case osfamily when :redhat, :suse then :rpm when :debian then :deb when :darwin then :osxpkg when :alpine then :apk end end |
.target=(value) ⇒ Object
48 49 50 |
# File 'lib/fpm/cookery/facts.rb', line 48 def target=(value) @target = value.to_sym end |