Module: SousChef

Defined in:
lib/sous-chef.rb

Defined Under Namespace

Modules: NodeHelpers, NodeTaskHelpers Classes: Collection, Node, NodeBuilder, NodeManager, Parser, TaskBuilder

Constant Summary collapse

CONFIG_TEMPLATE =
File.expand_path(File.join(File.dirname(__FILE__), 'templates', 'nodes.example.yml'))
CONFIG_FILE =
File.join(Dir.pwd, "nodes", "nodes.yml")

Class Method Summary collapse

Class Method Details

.config_file_locationObject



8
9
10
# File 'lib/sous-chef.rb', line 8

def config_file_location
  CONFIG_FILE
end

.config_template_locationObject



12
13
14
# File 'lib/sous-chef.rb', line 12

def config_template_location
  CONFIG_TEMPLATE
end

.create_configObject



16
17
18
19
20
21
22
23
# File 'lib/sous-chef.rb', line 16

def create_config
  if File.exists?(config_file_location)
    puts "nodes.yml already exists"
  else
    puts "Coping example nodes.yml and placing in #{config_file_location}"
    FileUtils.cp(config_template_location, config_file_location)
  end
end