Sha256: f1c3af34ab5397b60cd256bfd59a8750605ce46e339632a606db29c27489e013

Contents?: true

Size: 578 Bytes

Versions: 16

Compression:

Stored size: 578 Bytes

Contents

# frozen_string_literal: true

module Dry
  module System
    module Plugins
      # @api public
      class Env < Module
        DEFAULT_INFERRER = -> { :development }

        attr_reader :options

        # @api private
        def initialize(**options)
          @options = options
          super()
        end

        def inferrer
          options.fetch(:inferrer, DEFAULT_INFERRER)
        end

        # @api private
        def extended(system)
          system.setting :env, default: inferrer.(), reader: true
          super
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
dry-system-1.2.1 lib/dry/system/plugins/env.rb
dry-system-1.2.0 lib/dry/system/plugins/env.rb
dry-system-1.1.1 lib/dry/system/plugins/env.rb
dry-system-1.1.0 lib/dry/system/plugins/env.rb
dry-system-1.1.0.beta2 lib/dry/system/plugins/env.rb
dry-system-1.1.0.beta1 lib/dry/system/plugins/env.rb
dry-system-1.0.1 lib/dry/system/plugins/env.rb
dry-system-1.0.0 lib/dry/system/plugins/env.rb
dry-system-1.0.0.rc1 lib/dry/system/plugins/env.rb
dry-system-0.27.2 lib/dry/system/plugins/env.rb
dry-system-0.27.1 lib/dry/system/plugins/env.rb
dry-system-0.27.0 lib/dry/system/plugins/env.rb
dry-system-0.26.0 lib/dry/system/plugins/env.rb
dry-system-0.25.0 lib/dry/system/plugins/env.rb
dry-system-0.24.0 lib/dry/system/plugins/env.rb
dry-system-0.23.0 lib/dry/system/plugins/env.rb