lib/olaf/service_client.rb
def new_env_for_request(env, verb, path, params, headers)
      new_env = Rack::MockRequest.env_for(path,
                                          :method => verb.to_s.upcase,
                                          :params => params)
      new_env['rack.errors'] = env['rack.errors'] || STDOUT
      setup_logger( new_env )

      headers.each do |name, val|
        new_env["HTTP_#{name.to_s.upcase.gsub("-", "_")}"] = val
      end

      new_env
    end
#
# Create a new environment for the new request.
#
# Bug: right now, headers are copied from the old request
# by default, so they may be set when they shouldn't
# be.
#
# @todo Allow passing in input for PUT, POST and PATCH
#
Create a new environment for the new request.
Bug: right now, headers are copied from the old request
by default, so they may be set when they shouldn't
be.
Create a new environment for the new request . Bug : right now headers are copied from the old request by default so they may be set when they shouldn ' t be .
def new_env_for_request(env, verb, path, params, headers)
      new_env = Rack::MockRequest.env_for(path,
                                          :method => verb.to_s.upcase,
                                          :params => params)
      new_env['rack.errors'] = env['rack.errors'] || STDOUT
      setup_logger( new_env )
      headers.each do |name, val|
        new_env["HTTP_#{name.to_s.upcase.gsub("-", "_")}"] = val
      end
      new_env
    end
def new_env_for_request ( env , verb , path , params , headers ) new_env = Rack :: MockRequest . env_for ( path , :method => verb . to_s . upcase , :params => params ) new_env [ 'rack.errors' ] = env [ 'rack.errors' ] || STDOUT setup_logger ( new_env ) headers . each do | name , val | new_env [ "HTTP_#{name.to_s.upcase.gsub("-", "_")}" ] = val end new_env end
Create a new environment for the new request.
Create a new environment for the new request .
env
verb
path
params
headers
todo
Allow passing in input for PUT, POST and PATCH
Allow passing in input for PUT POST and PATCH