Sha256: a3f77824188c6b76e8ae6eb421e859092be8c045b806f38e489deaa0133b71cf

Contents?: true

Size: 369 Bytes

Versions: 4

Compression:

Stored size: 369 Bytes

Contents

require 'faraday'



module Saddle
  module Middleware

    # Public: Adds the content of `extra_env` into the env variable

    class ExtraEnv < Faraday::Middleware
      def call(env)
        if env[:request][:client_options][:extra_env]
          env.merge!(env[:request][:client_options][:extra_env])
        end

        @app.call env
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
saddle-0.0.53 lib/saddle/middleware/extra_env.rb
saddle-0.0.51 lib/saddle/middleware/extra_env.rb
saddle-0.0.50 lib/saddle/middleware/extra_env.rb
saddle-0.0.49 lib/saddle/middleware/extra_env.rb