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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/request.rb +2 -6
  3. data/lib/web_session.rb +3 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f4bfe738723c0ec5a5fb0073e68d55594b7cc64a
4
- data.tar.gz: 85522d011791fb9de097b30fb4c004101f2c4314
3
+ metadata.gz: 3f25b4868627a111dfabc038fc4345b82a1c0178
4
+ data.tar.gz: 8c98b4a7445d6aa87fd5f92c6197f83dd9543455
5
5
  SHA512:
6
- metadata.gz: 0aebc95872b35abea66ca56d30509fe6f6a38f76d26d0133d1fa88a71869672feea97fa628cd4f7fad1021800ae53a617ec13166e262ecfca617a51debac3cd4
7
- data.tar.gz: d4fd83062445233eccba32ce1bbdd93759b0f2cdccdf8c49ddb50296cb38cf40870e74ea847127771595034ec74653ef8c09dc2de4cc2d504ffd9d918b656242
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 = true
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webtester
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego F. Nascimento