Skip to content

Commit

Permalink
Merge pull request #132 from acidlabs/fix-circular-require
Browse files Browse the repository at this point in the history
Fix a few warnings, among which a circular require
  • Loading branch information
rogerleite committed Oct 6, 2014
2 parents 0073ea1 + b1ea855 commit 733d706
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/httpi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def query_builder=(builder)
builder_name = builder.to_s.capitalize
begin
builder = HTTPI::QueryBuilder.const_get(builder_name)
rescue NameError => ex
rescue NameError
raise ArgumentError, "Invalid builder. Available builders are: [:flat, :nested]"
end
end
Expand Down
1 change: 0 additions & 1 deletion lib/httpi/adapter/base.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require "httpi"
require "httpi/adapter"

module HTTPI
Expand Down
2 changes: 1 addition & 1 deletion lib/httpi/adapter/curb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def setup_ssl_auth
end

def respond_with(client)
status, headers = parse_header_string(client.header_str)
headers = parse_header_string(client.header_str).last
Response.new client.response_code, headers, client.body_str
end

Expand Down
2 changes: 1 addition & 1 deletion lib/httpi/adapter/net_http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def request_client(type)
end

request_client = request_class.new @request.url.request_uri, @request.headers
request_client.basic_auth *@request.auth.credentials if @request.auth.basic?
request_client.basic_auth(*@request.auth.credentials) if @request.auth.basic?

if @request.auth.digest?
raise NotSupportedError, "Net::HTTP does not support HTTP digest authentication"
Expand Down
4 changes: 2 additions & 2 deletions lib/httpi/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ def gzip
# or an Array of `HTTPI::Cookie` objects.
def set_cookies(object_or_array)
if object_or_array.respond_to?(:cookies)
cookie_store.add *object_or_array.cookies
cookie_store.add(*object_or_array.cookies)
else
cookie_store.add *object_or_array
cookie_store.add(*object_or_array)
end

cookies = cookie_store.fetch
Expand Down
3 changes: 2 additions & 1 deletion lib/httpi/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ def initialize(code, headers, body)
self.raw_body = body
end

attr_accessor :code, :headers, :raw_body, :attachments
attr_accessor :code, :headers, :raw_body
attr_writer :attachments

# Returns whether the HTTP response is considered successful.
def error?
Expand Down

0 comments on commit 733d706

Please sign in to comment.