Sha256: 2e36f5fad9733fe2b14ff5fb93ef97635f39ced5672ec566c80b7c5752c8a6e4
Contents?: true
Size: 599 Bytes
Versions: 26
Compression:
Stored size: 599 Bytes
Contents
# frozen_string_literal: true require 'erb' require 'yaml' require_relative 'configurable' module Branch module Name module Loadable include Configurable def load_options(defaults: {}) options = {} options.merge!(load_config(global_config_file)) options.merge!(load_config(local_config_file)) options.presence || defaults end def load_config(config_file) return {} unless File.exist? config_file yaml_options = File.read(config_file) YAML.safe_load ERB.new(yaml_options).result end end end end
Version data entries
26 entries across 26 versions & 1 rubygems