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

.osmajorreleaseObject



22
23
24
# File 'lib/fpm/cookery/facts.rb', line 22

def self.osmajorrelease
  @osmajorrelease ||= Facter.fact(:operatingsystemmajrelease).value
end

.osreleaseObject



18
19
20
# File 'lib/fpm/cookery/facts.rb', line 18

def self.osrelease
  @osrelease ||= Facter.fact(:operatingsystemrelease).value
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



38
39
40
# File 'lib/fpm/cookery/facts.rb', line 38

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

.targetObject



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