Class: FPM::Cookery::Facts

Inherits:
Object
  • Object
show all
Defined in:
lib/fpm/cookery/facts.rb

Class Method Summary collapse

Class Method Details

.archObject



6
7
8
# File 'lib/fpm/cookery/facts.rb', line 6

def self.arch
  @arch ||= Facter.fact(:architecture).value.downcase.to_sym
end

.platformObject



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



30
31
32
# File 'lib/fpm/cookery/facts.rb', line 30

def self.reset!
  instance_variables.each {|v| instance_variable_set(v, nil) }
end

.targetObject



18
19
20
21
22
23
24
# 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
              when :darwin                   then :osxpkg
              end
end

.target=(value) ⇒ Object



26
27
28
# File 'lib/fpm/cookery/facts.rb', line 26

def self.target=(value)
  @target = value.to_sym
end