Sha256: a0a4245fba801357edc047b3afb357db4677ffa3560f4aa1c8a4ef3c136d2bd5

Contents?: true

Size: 853 Bytes

Versions: 4

Compression:

Stored size: 853 Bytes

Contents

# frozen_string_literal: true

require "dry/container"

module Pennyworth
  module CLI
    module Actions
      # Provides a single container with application and action specific dependencies.
      module Container
        extend Dry::Container::Mixin

        config.registry = ->(container, key, value, _options) { container[key.to_s] = value }

        merge Pennyworth::Container

        register(:config) { Config.new }
        register(:encodings) { Encodings.new }
        register(:git_hub) { GitHub.new }
        register(:http_statuses) { HTTPStatuses.new }
        register(:ruby_gems) { RubyGems.new }
        register(:standard_errors) { StandardErrors.new }
        register(:system_errors) { System::Errors.new }
        register(:system_signals) { System::Signals.new }
        register(:text) { Text.new }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pennyworth-13.5.0 lib/pennyworth/cli/actions/container.rb
pennyworth-13.4.0 lib/pennyworth/cli/actions/container.rb
pennyworth-13.3.0 lib/pennyworth/cli/actions/container.rb
pennyworth-13.2.0 lib/pennyworth/cli/actions/container.rb