Method: Nutkins::CloudManager#initialize

Defined in:
lib/nutkins.rb

#initialize(project_dir: nil) ⇒ CloudManager

Returns a new instance of CloudManager.



29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/nutkins.rb', line 29

def initialize(project_dir: nil)
  @img_configs = {}
  # when an image is built true is stored against it's name to avoid building it again
  @built = {}
  @etcd_running = false
  @project_root = project_dir || Dir.pwd
  cfg_path = File.join(@project_root, CONFIG_FILE_NAME)
  if File.exists? cfg_path
    @config = OpenStruct.new(YAML.load_file cfg_path)
  else
    @config = OpenStruct.new
  end
end