Module: YamlExt

Defined in:
lib/yaml_ext.rb,
lib/yaml_ext/version.rb

Constant Summary collapse

VERSION =
"0.1.2".freeze

Class Method Summary collapse

Class Method Details

.load(path) ⇒ Object



7
8
9
# File 'lib/yaml_ext.rb', line 7

def load(path)
  parse_nodes(:ref_inner_node, load_with_extended_nodes(path), path)
end

.load_with_erb(path) ⇒ Object



15
16
17
# File 'lib/yaml_ext.rb', line 15

def load_with_erb(path)
  YAML.safe_load(ERB.new(File.read(path), trim_mode: "-").result)
end

.load_with_extended_nodes(path) ⇒ Object



11
12
13
# File 'lib/yaml_ext.rb', line 11

def load_with_extended_nodes(path)
  parse_nodes(:ref_extended_node, load_with_erb(path), path)
end