Class: Puppet::Util::RunMode
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(name) ⇒ RunMode
Returns a new instance of RunMode.
6
7
8
|
# File 'lib/puppet/util/run_mode.rb', line 6
def initialize(name)
@name = name.to_sym
end
|
Instance Attribute Details
Returns the value of attribute name.
10
11
12
|
# File 'lib/puppet/util/run_mode.rb', line 10
def name
@name
end
|
Class Method Details
12
13
14
15
16
17
18
19
|
# File 'lib/puppet/util/run_mode.rb', line 12
def self.[](name)
@run_modes ||= {}
if Puppet.features.microsoft_windows?
@run_modes[name] ||= WindowsRunMode.new(name)
else
@run_modes[name] ||= UnixRunMode.new(name)
end
end
|
Instance Method Details
#agent? ⇒ Boolean
25
26
27
|
# File 'lib/puppet/util/run_mode.rb', line 25
def agent?
name == :agent
end
|
37
38
39
|
# File 'lib/puppet/util/run_mode.rb', line 37
def log_dir
RunMode[name].log_dir
end
|
#master? ⇒ Boolean
21
22
23
|
# File 'lib/puppet/util/run_mode.rb', line 21
def master?
name == :master
end
|
33
34
35
|
# File 'lib/puppet/util/run_mode.rb', line 33
def run_dir
RunMode[name].run_dir
end
|
#user? ⇒ Boolean
29
30
31
|
# File 'lib/puppet/util/run_mode.rb', line 29
def user?
name == :user
end
|