require 'yaml' require 'active_support/core_ext/hash/indifferent_access' module Pears module Provider # Used for loading simple YAML file locally. class LocalFile < Base def initialize(file_path, on_failure: :raise) yaml_data = File.read(file_path) @data = parse_yaml(yaml_data) rescue Errno::ENOENT, Pears::InvalidProviderData => error if on_failure == :null @data = {} else raise error end end end end end