Sha256: 38c6bd5775897bbf6ccedccd0e625aa15110e15a0e16445e4da43b9e05d692b8

Contents?: true

Size: 849 Bytes

Versions: 15

Compression:

Stored size: 849 Bytes

Contents

# frozen_string_literal: true

# Rails 5 deprecates calling HTTP action methods with positional arguments
# in favor of keyword arguments. However, the keyword argument form is only
# supported in Rails 5+. Since we support back to 4, we need some sort of shim
# to avoid super noisy deprecations when running tests.
module RoutingHTTPMethodShim
  def get(path, **args)
    super(path, args[:params], args[:headers])
  end

  def post(path, **args)
    super(path, args[:params], args[:headers])
  end

  def put(path, **args)
    super(path, args[:params], args[:headers])
  end
end

module ControllerHTTPMethodShim
  def process(action, http_method = "GET", **args)
    if (as = args.delete(:as))
      @request.headers["Content-Type"] = Mime[as].to_s
    end

    super(action, http_method, args[:params], args[:session], args[:flash])
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
doorkeeper-5.1.2 spec/support/http_method_shim.rb
doorkeeper-5.2.6 spec/support/http_method_shim.rb
doorkeeper-5.1.1 spec/support/http_method_shim.rb
doorkeeper-5.2.5 spec/support/http_method_shim.rb
doorkeeper-sequel-2.2.0 spec/support/http_method_shim.rb
doorkeeper-5.2.4 spec/support/http_method_shim.rb
doorkeeper-5.2.3 spec/support/http_method_shim.rb
doorkeeper-5.2.2 spec/support/http_method_shim.rb
doorkeeper-sequel-2.1.0 spec/support/http_method_shim.rb
doorkeeper-5.2.1 spec/support/http_method_shim.rb
doorkeeper-5.2.0 spec/support/http_method_shim.rb
doorkeeper-5.2.0.rc3 spec/support/http_method_shim.rb
doorkeeper-5.2.0.rc2 spec/support/http_method_shim.rb
doorkeeper-5.2.0.rc1 spec/support/http_method_shim.rb
doorkeeper-5.1.0 spec/support/http_method_shim.rb