em-http-test 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,6 +8,14 @@ module EventMachine::HttpTest
8
8
 
9
9
  # Base test request object that contains the test data
10
10
  class Request
11
+ @@reqOptions = {
12
+ :connect_timeout => 5, # default connection setup timeout
13
+ :inactivity_timeout => 30, # default connection inactivity (post-setup) timeout
14
+ }
15
+
16
+ def self.option(opts = {})
17
+ opts.each { |k,v| self.reqOptions[k] =v }
18
+ end
11
19
 
12
20
  def initialize(type, url, options = {})
13
21
  @type = type
@@ -20,15 +28,11 @@ module EventMachine::HttpTest
20
28
  end
21
29
 
22
30
  def toRequest
23
- opts = {
24
- :connect_timeout => 5, # default connection setup timeout
25
- :inactivity_timeout => 30, # default connection inactivity (post-setup) timeout
26
- }
27
31
  case @type
28
32
  when :GET
29
- EM::HttpRequest.new(@url, opts).get @options
33
+ EM::HttpRequest.new(@url, @@reqOptions).get @options
30
34
  when :POST
31
- EM::HttpRequest.new(@url, opts).post @options
35
+ EM::HttpRequest.new(@url, @@reqOptions).post @options
32
36
  end
33
37
  end
34
38
  end
@@ -1,5 +1,5 @@
1
1
  module EventMachine
2
2
  class HttpTest
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: em-http-test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: