lib/yaml_extend.rb in yaml_extend-1.1.4 vs lib/yaml_extend.rb in yaml_extend-1.2.0
- old
+ new
@@ -67,11 +67,11 @@
# @option options [Boolean] :extend_existing_arrays Set to true to extend existing arrays, instead of overwriting them - DEFAULT: true
# @option options [Boolean] :merge_nil_values Set to true to merge nil hash values, overwriting a possibly non-nil value - DEFAULT: false
# @option options [Boolean] :merge_debug Set to true to get console output of merge process for debugging - DEFAULT: false
#
# @param [Boolean] options Fallback for backward compatiblity: extend existing arrays instead of replacing them (deep_merge)
- # @return [Hash] the resulting yaml config
+ # @return [Hash] the resulting yaml config
#
def self.ext_load_file(yaml_path, inheritance_key = nil, options = {})
YAML.ext_load_file_recursive(yaml_path, inheritance_key, options, {})
end
@@ -109,13 +109,13 @@
yaml_path = YAML.make_absolute_path yaml_path
super_config =
if yaml_path.match(/(\.erb\.|\.erb$)/)
- YAML.load(ERB.new(File.read(yaml_path)).result)
+ YAML.unsafe_load(ERB.new(File.read(yaml_path)).result)
else
- YAML.load_file(File.open(yaml_path))
+ YAML.unsafe_load_file(File.open(yaml_path))
end
super_inheritance_files = yaml_value_by_key inheritance_key, super_config
unless options[:preserve_inheritance_key]
delete_yaml_key inheritance_key, super_config # we don't merge the super inheritance keys into the base yaml
@@ -136,11 +136,11 @@
end
deep_merge_options = options.select { |k, v| DEEP_MERGE_OPTIONS.include? k }
total_config.deeper_merge!(super_config, deep_merge_options)
end
- # some logic to ensure absolute file inheritance as well as
- # relative file inheritance in yaml files
+ # some logic to ensure absolute file inheritance as well as
+ # relative file inheritance in yaml files
def self.make_absolute_path(file_path)
private_class_method
return file_path if YAML.absolute_path?(file_path) && File.exist?(file_path)
# caller_locations returns the current execution stack
# [0] is the call from ext_load_file_recursive,