Sha256: a6e1503da33a331fba870e466bfe3e685e2dccfb541f6ebb667002484b0c83b9
Contents?: true
Size: 861 Bytes
Versions: 29
Compression:
Stored size: 861 Bytes
Contents
require "pathname" require "refinements/hashes" require "refinements/structs" require "runcom" require "yaml" <% namespace do %> 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 "<%= configuration.project_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).freeze private attr_reader :content, :client end end <% end %>
Version data entries
29 entries across 29 versions & 1 rubygems