Module: Jerakia::Scope::Yaml

Defined in:
lib/jerakia/scope/yaml.rb

Instance Method Summary collapse

Instance Method Details

#createObject

Raises:


4
5
6
7
8
9
10
11
# File 'lib/jerakia/scope/yaml.rb', line 4

def create
  yaml_file = request.scope_options['file'] || './jerakia_scope.yaml'
  raise Jerakia::Error, "Scope file #{yaml_file} not found" unless File.exist?(yaml_file)
  data = YAML.load(File.read(yaml_file))
  data.each do |key, val|
    value[key.to_sym] = val
  end
end