Class: FPM::Cookery::Facts
- Inherits:
-
Object
- Object
- FPM::Cookery::Facts
- Defined in:
- lib/fpm/cookery/facts.rb
Class Method Summary collapse
- .arch ⇒ Object
- .osmajorrelease ⇒ Object
- .osrelease ⇒ Object
- .platform ⇒ Object
- .platform=(value) ⇒ Object
- .reset! ⇒ Object
- .target ⇒ Object
- .target=(value) ⇒ Object
Class Method Details
.arch ⇒ Object
6 7 8 |
# File 'lib/fpm/cookery/facts.rb', line 6 def self.arch @arch ||= Facter.fact(:architecture).value.downcase.to_sym end |
.osmajorrelease ⇒ Object
22 23 24 |
# File 'lib/fpm/cookery/facts.rb', line 22 def self.osmajorrelease @osmajorrelease ||= Facter.fact(:operatingsystemmajrelease).value end |
.osrelease ⇒ Object
18 19 20 |
# File 'lib/fpm/cookery/facts.rb', line 18 def self.osrelease @osrelease ||= Facter.fact(:operatingsystemrelease).value end |
.platform ⇒ Object
10 11 12 |
# File 'lib/fpm/cookery/facts.rb', line 10 def self.platform @platform ||= Facter.fact(:operatingsystem).value.downcase.to_sym end |
.platform=(value) ⇒ Object
14 15 16 |
# File 'lib/fpm/cookery/facts.rb', line 14 def self.platform=(value) @platform = value.downcase.to_sym end |
.reset! ⇒ Object
38 39 40 |
# File 'lib/fpm/cookery/facts.rb', line 38 def self.reset! instance_variables.each {|v| instance_variable_set(v, nil) } end |
.target ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/fpm/cookery/facts.rb', line 26 def self.target @target ||= case platform when :centos, :redhat, :fedora, :amazon, :scientific then :rpm when :debian, :ubuntu then :deb when :darwin then :osxpkg end end |
.target=(value) ⇒ Object
34 35 36 |
# File 'lib/fpm/cookery/facts.rb', line 34 def self.target=(value) @target = value.to_sym end |