Sha256: 85e6f1fe91d7fddc3d274c306b0ede50d243486c8404f4d6c74b34d60cce006c

Contents?: true

Size: 830 Bytes

Versions: 34

Compression:

Stored size: 830 Bytes

Contents

require "pact_broker/logging"

module PactBroker
  module Api
    module Middleware
      class Configuration
        include PactBroker::Logging

        def initialize(app, configuration)
          @app = app
          @configuration = configuration
        end

        def call(env)
          if (overrides = env["pactbroker.configuration_overrides"])&.any?
            dupped_configuration = configuration.dup
            dupped_configuration.override_runtime_configuration!(overrides)
            dupped_configuration.freeze
            PactBroker.set_configuration(dupped_configuration)
            app.call(env)
          else
            PactBroker.set_configuration(configuration)
            app.call(env)
          end
        end

        private

        attr_reader :app, :configuration
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
pact_broker-2.107.1 lib/pact_broker/api/middleware/configuration.rb
pact_broker-2.107.0 lib/pact_broker/api/middleware/configuration.rb
pact_broker-2.107.0.beta.1 lib/pact_broker/api/middleware/configuration.rb
pact_broker-2.106.0 lib/pact_broker/api/middleware/configuration.rb
pact_broker-2.105.0 lib/pact_broker/api/middleware/configuration.rb
pact_broker-2.104.0 lib/pact_broker/api/middleware/configuration.rb
pact_broker-2.103.0 lib/pact_broker/api/middleware/configuration.rb
pact_broker-2.102.2 lib/pact_broker/api/middleware/configuration.rb
pact_broker-2.102.1 lib/pact_broker/api/middleware/configuration.rb
pact_broker-2.102.0 lib/pact_broker/api/middleware/configuration.rb
pact_broker-2.101.0 lib/pact_broker/api/middleware/configuration.rb
pact_broker-2.100.0 lib/pact_broker/api/middleware/configuration.rb
pact_broker-2.99.0 lib/pact_broker/api/middleware/configuration.rb
pact_broker-2.98.0 lib/pact_broker/api/middleware/configuration.rb
pact_broker-2.97.0 lib/pact_broker/api/middleware/configuration.rb
pact_broker-2.96.0 lib/pact_broker/api/middleware/configuration.rb
pact_broker-2.95.1 lib/pact_broker/api/middleware/configuration.rb
pact_broker-2.95.0 lib/pact_broker/api/middleware/configuration.rb
pact_broker-2.94.0 lib/pact_broker/api/middleware/configuration.rb
pact_broker-2.93.4 lib/pact_broker/api/middleware/configuration.rb