Class: Avm::Launcher::Context::Settings

Inherits:
Object
  • Object
show all
Includes:
EacRubyUtils::SimpleCache
Defined in:
lib/avm/launcher/context/settings.rb

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ Settings

Returns a new instance of Settings.



13
14
15
16
17
18
19
# File 'lib/avm/launcher/context/settings.rb', line 13

def initialize(file)
  unless ::File.exist?(file)
    ::FileUtils.mkdir_p(::File.dirname(file))
    ::File.write(file, {}.to_yaml)
  end
  @data = YAML.load_file(file)
end

Instance Method Details

#instance_settings(instance) ⇒ Object



21
22
23
# File 'lib/avm/launcher/context/settings.rb', line 21

def instance_settings(instance)
  ::Avm::Launcher::Instances::Settings.new(value(['Instances', instance.name]))
end