From 9e2a0e64e045fbddd2d0e0a2e5bbc7f81a15a186 Mon Sep 17 00:00:00 2001 From: Paulo L F Casaretto Date: Tue, 12 Jun 2012 14:03:57 -0300 Subject: [PATCH] Change the param order for get, to make it similar to Net::HTTP.get --- lib/tor/http.rb | 2 +- spec/http_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tor/http.rb b/lib/tor/http.rb index bc11455..1df173d 100644 --- a/lib/tor/http.rb +++ b/lib/tor/http.rb @@ -5,7 +5,7 @@ module Tor class HTTP - def self.get(host, port = 80, path = "/") + def self.get(host, path = "/", port = 80) res = "" Net::HTTP.SOCKSProxy(Tor.configuration.ip, Tor.configuration.port).start(host, port) do |http| res = http.get(path) diff --git a/spec/http_spec.rb b/spec/http_spec.rb index 2e617ec..d3fc1f5 100644 --- a/spec/http_spec.rb +++ b/spec/http_spec.rb @@ -10,7 +10,7 @@ end it "makes a HTTP request to Google" do - res = Tor::HTTP.get("google.com", 80, "/") + res = Tor::HTTP.get("google.com", "/", 80) res.code.should eq("301") end