Sha256: b9b18eb6e1a91a3cc76874dbe7b085b8f6b7271c5501d7cbc820b8b6442f366e
Contents?: true
Size: 514 Bytes
Versions: 11
Compression:
Stored size: 514 Bytes
Contents
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
Version data entries
11 entries across 11 versions & 1 rubygems