webtester 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/request.rb +2 -6
- data/lib/web_session.rb +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f25b4868627a111dfabc038fc4345b82a1c0178
|
4
|
+
data.tar.gz: 8c98b4a7445d6aa87fd5f92c6197f83dd9543455
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 196f34578cce04f016ced4d755d0087ce60dc751f5f522ddf5ea9c22d0368291715f17b03bb8b10adf3c6245bfdfc847afecb9eeeb802a2967b82ef068b73bbf
|
7
|
+
data.tar.gz: b0ac7afe1c201a3973978e0d1eb14077a0c4dbba507bed90e0f633280b54c4ab81202dbadf89c1e332a282e28ec8302b032f4ee429d1a51431de3b22e5ba36c0
|
data/lib/request.rb
CHANGED
@@ -15,11 +15,11 @@ module WT
|
|
15
15
|
attr_accessor :proxy_host
|
16
16
|
attr_accessor :proxy_port
|
17
17
|
|
18
|
-
def initialize(request_type, request_url, request_data = {})
|
18
|
+
def initialize(request_type, request_url, request_data = {}, follow_redirect = true)
|
19
19
|
@request_type = request_type
|
20
20
|
@request_url = request_url
|
21
21
|
@request_data = request_data
|
22
|
-
@follow_redirect =
|
22
|
+
@follow_redirect = follow_redirect
|
23
23
|
@headers = {}
|
24
24
|
@proxy_host = nil
|
25
25
|
@proxy_port = 0
|
@@ -38,8 +38,6 @@ module WT
|
|
38
38
|
url.path = '/' unless url.path.length > 0
|
39
39
|
req = Net::HTTP::Get.new(url.to_s)
|
40
40
|
|
41
|
-
puts url.to_s
|
42
|
-
|
43
41
|
return self.send url.host, url.port, req
|
44
42
|
end
|
45
43
|
|
@@ -48,8 +46,6 @@ module WT
|
|
48
46
|
url.path = '/' unless url.path.length > 0
|
49
47
|
req = Net::HTTP::Post.new(url.to_s)
|
50
48
|
|
51
|
-
puts url.to_s
|
52
|
-
|
53
49
|
return send url.host, url.port, req
|
54
50
|
end
|
55
51
|
|
data/lib/web_session.rb
CHANGED
@@ -8,11 +8,13 @@ module WT
|
|
8
8
|
attr_accessor :proxy_host
|
9
9
|
attr_accessor :proxy_port
|
10
10
|
|
11
|
-
def initialize
|
11
|
+
def initialize(&block)
|
12
12
|
@cookies = []
|
13
13
|
@form_fields = {}
|
14
14
|
@proxy_host = nil
|
15
15
|
@proxy_port = 0
|
16
|
+
|
17
|
+
block.call(self) if block
|
16
18
|
end
|
17
19
|
|
18
20
|
def request(req, &block)
|