Skip to content

Commit

Permalink
Should use if, not unless
Browse files Browse the repository at this point in the history
  • Loading branch information
tmertens committed Feb 21, 2014
1 parent 4bf591c commit 54fc3de
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/billy/handlers/cache_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def self.cache

def handle_request(method, url, headers, body)
method = method.downcase
unless handles_request?(method, url, headers, body)
if handles_request?(method, url, headers, body)
if (response = cache.fetch(method, url, body))
Billy.log(:info, "puffing-billy: CACHE #{method} for '#{url}'")
return response
Expand Down
2 changes: 1 addition & 1 deletion lib/billy/handlers/proxy_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def handles_request?(method, url, headers, body)
end

def handle_request(method, url, headers, body)
unless handles_request?(method, url, headers, body)
if handles_request?(method, url, headers, body)
req = EventMachine::HttpRequest.new(url)
build_request_options(headers, body).tap do |opts|
req = req.send(method.downcase, build_request_options(headers, body))
Expand Down
2 changes: 1 addition & 1 deletion lib/billy/handlers/stub_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class StubHandler
include Handler

def handle_request(method, url, headers, body)
unless handles_request?(method, url, headers, body)
if handles_request?(method, url, headers, body)
if (stub = find_stub(method, url))
query_string = URI.parse(url).query || ""
params = CGI.parse(query_string)
Expand Down

0 comments on commit 54fc3de

Please sign in to comment.