Sha256: 4746b940c00f01bcb1a78a07fafb28dfccae2dfcd08dc21be1cf4d961aa90e1e

Contents?: true

Size: 907 Bytes

Versions: 9

Compression:

Stored size: 907 Bytes

Contents

# frozen_string_literal: true

require "cogger"
require "containable"
require "etcher"
require "runcom"
require "spek"

module Pragmater
  # Provides a global gem container for injection into other objects.
  module Container
    extend Containable

    register :registry do
      Etcher::Registry.new(contract: Configuration::Contract, model: Configuration::Model)
                      .add_loader(:yaml, self[:defaults_path])
                      .add_loader(:yaml, self[:xdg_config].active)
    end

    register(:settings) { Etcher.call(self[:registry]).dup }
    register(:specification) { Spek::Loader.call "#{__dir__}/../../pragmater.gemspec" }
    register(:defaults_path) { Pathname(__dir__).join("configuration/defaults.yml") }
    register(:xdg_config) { Runcom::Config.new "pragmater/configuration.yml" }
    register(:logger) { Cogger.new id: :pragmater }
    register :io, STDOUT
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
pragmater-16.0.0 lib/pragmater/container.rb
pragmater-15.7.0 lib/pragmater/container.rb
pragmater-15.6.0 lib/pragmater/container.rb
pragmater-15.5.0 lib/pragmater/container.rb
pragmater-15.4.0 lib/pragmater/container.rb
pragmater-15.3.0 lib/pragmater/container.rb
pragmater-15.2.0 lib/pragmater/container.rb
pragmater-15.1.0 lib/pragmater/container.rb
pragmater-15.0.0 lib/pragmater/container.rb