Sha256: 034347c70bfebd86b304a5bc5852ea413f8e1504b081ce8dc481aec9a4fb0fe8
Contents?: true
Size: 855 Bytes
Versions: 3
Compression:
Stored size: 855 Bytes
Contents
# frozen_string_literal: true require "pathname" require "refinements/hashes" require "refinements/structs" require "runcom" require "yaml" module Pennyworth module Configuration # Represents the fully assembled Command Line Interface (CLI) configuration. class Loader using Refinements::Hashes using Refinements::Structs DEFAULTS = YAML.load_file(Pathname(__dir__).join("defaults.yml")).freeze CLIENT = Runcom::Config.new "#{Identity::NAME}/configuration.yml", defaults: DEFAULTS def self.call = new.call def self.with_defaults = new(client: DEFAULTS) def initialize content: Content.new, client: CLIENT @content = content @client = client end def call = content.merge(**client.to_h.flatten_keys) private attr_reader :content, :client end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
pennyworth-12.0.2 | lib/pennyworth/configuration/loader.rb |
pennyworth-12.0.1 | lib/pennyworth/configuration/loader.rb |
pennyworth-12.0.0 | lib/pennyworth/configuration/loader.rb |