55
56
57
58
59
60
61
62
63
64
65
|
# File 'lib/feature_map/private/additional_metrics_file.rb', line 55
def self.load_features!
metrics_content = YAML.load_file(path)
return metrics_content[FEATURES_KEY] if metrics_content.is_a?(Hash) && metrics_content[FEATURES_KEY]
raise FileContentError, "Unexpected content found in #{path}. Use `bin/featuremap additional_metrics` to regenerate it and try again."
rescue Psych::SyntaxError => e
raise FileContentError, "Invalid YAML content found at #{path}. Error: #{e.message} Use `bin/featuremap additional_metrics` to generate it and try again."
rescue Errno::ENOENT
raise FileContentError, "No feature metrics file found at #{path}. Use `bin/featuremap additional_metrics` to generate it and try again."
end
|