parent
7ce4309fcb
commit
324851eeb5
1 changed files with 12 additions and 1 deletions
|
|
@ -19,8 +19,19 @@ module BundlerHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
private_class_method def self.parse_value_from_yaml_file(file, *keys)
|
private_class_method def self.parse_value_from_yaml_file(file, *keys)
|
||||||
|
parse_yaml_file(file).dig(*keys)
|
||||||
|
end
|
||||||
|
|
||||||
|
private_class_method def self.parse_yaml_file(file)
|
||||||
path = File.join(__dir__, file)
|
path = File.join(__dir__, file)
|
||||||
YAML.load_file(path).dig(*keys) if File.file?(path)
|
|
||||||
|
return {} unless File.file?(path)
|
||||||
|
|
||||||
|
if YAML.respond_to?(:unsafe_load_file)
|
||||||
|
YAML.unsafe_load_file(path)
|
||||||
|
else
|
||||||
|
YAML.load_file(path)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private_class_method def self.parse_value_from_toml_file(file, key)
|
private_class_method def self.parse_value_from_toml_file(file, key)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue