Sha256: b152520ce2487f39184368c6a02431c2cbcf16cb8898bc4ea11ff64da355a34c

Contents?: true

Size: 725 Bytes

Versions: 8

Compression:

Stored size: 725 Bytes

Contents

module ExvoAuth::Autonomous::Http
  def get(*args)
    http.get(*args)
  end

  def post(*args)
    http.post(*args)
  end

  def put(path, options = {})
    # This fixes 411 responses from nginx (on heroku)
    # when Content-Length is missing on put requests.
    options[:body] ||= ""
    http.put(path, options)
  end

  def delete(*args)
    http.delete(*args)
  end

  def head(*args)
    http.head(*args)
  end

  def options(*args)
    http.options(*args)
  end

  protected

  def http
    basement.base_uri(base_uri)
    basement.basic_auth(username, password)
    basement
  end

  def basement
    @basement ||= Class.new do
      include HTTParty
      debug_output if Exvo::Helpers.auth_debug
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
exvo_auth-0.16.5 lib/exvo_auth/autonomous/http.rb
exvo_auth-0.16.4 lib/exvo_auth/autonomous/http.rb
exvo_auth-0.16.3 lib/exvo_auth/autonomous/http.rb
exvo_auth-0.16.2 lib/exvo_auth/autonomous/http.rb
exvo_auth-0.16.1 lib/exvo_auth/autonomous/http.rb
exvo_auth-0.16.0 lib/exvo_auth/autonomous/http.rb
exvo_auth-0.15.1 lib/exvo_auth/autonomous/http.rb
exvo_auth-0.15.0 lib/exvo_auth/autonomous/http.rb