Class: Gusteau::Config

Inherits:
Object
  • Object
show all
Includes:
ERB
Defined in:
lib/gusteau/config.rb

Constant Summary collapse

DEFAULT_CHEF_VERSION =
'11.4.4'

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ERB

#read_erb, #read_erb_yaml

Constructor Details

#initialize(config_path) ⇒ Config

Returns a new instance of Config.



22
23
24
25
26
27
28
# File 'lib/gusteau/config.rb', line 22

def initialize(config_path)
  @config = if File.exists?(config_path)
    read_erb_yaml(config_path)
  else
    abort ".gusteau.yml not found"
  end
end

Class Method Details

.nodesObject



14
15
16
# File 'lib/gusteau/config.rb', line 14

def self.nodes
  @instance.send(:nodes)
end

.read(config_path) ⇒ Object



10
11
12
# File 'lib/gusteau/config.rb', line 10

def self.read(config_path)
  @instance = Gusteau::Config.new(config_path)
end

.settingsObject



18
19
20
# File 'lib/gusteau/config.rb', line 18

def self.settings
  @instance.send(:settings)
end