Class: FPM::Cookery::Facts
- Inherits:
-
Object
- Object
- FPM::Cookery::Facts
- Defined in:
- lib/fpm/cookery/facts.rb
Class Method Summary collapse
- .arch ⇒ 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 |
.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
29 30 31 |
# File 'lib/fpm/cookery/facts.rb', line 29 def self.reset! instance_variables.each {|v| instance_variable_set(v, nil) } end |
.target ⇒ Object
18 19 20 21 22 23 |
# File 'lib/fpm/cookery/facts.rb', line 18 def self.target @target ||= case platform when :centos, :redhat, :fedora then :rpm when :debian, :ubuntu then :deb end end |
.target=(value) ⇒ Object
25 26 27 |
# File 'lib/fpm/cookery/facts.rb', line 25 def self.target=(value) @target = value.to_sym end |