http-request 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/http-request.rb +4 -3
  3. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.4
1
+ 1.0.5
data/lib/http-request.rb CHANGED
@@ -33,7 +33,7 @@
33
33
  require 'net/http'
34
34
 
35
35
  class HttpRequest
36
- VERSION = '1.0.4'
36
+ VERSION = '1.0.5'
37
37
 
38
38
  class HTTPError < StandardError; end
39
39
  class UnexpectedError < StandardError; end
@@ -49,7 +49,7 @@ class HttpRequest
49
49
  attr_accessor :status
50
50
 
51
51
  class << self
52
- attr_accessor :user_agent, :timeout
52
+ attr_accessor :user_agent, :timeout, :max_retries
53
53
  end
54
54
 
55
55
 
@@ -81,6 +81,7 @@ class HttpRequest
81
81
  redirect_limit = options[:redirect_limit] || 5
82
82
  output_file = options[:output_file]
83
83
  content_max = options[:content_max]
84
+ max_retries = HttpRequest.max_retries || 3
84
85
 
85
86
  # Check if we're in a redirecting loop
86
87
  if redirect_limit == 0
@@ -100,7 +101,7 @@ class HttpRequest
100
101
  end
101
102
 
102
103
  # HTTP request block
103
- @retries = 3
104
+ @retries = max_retries
104
105
  begin
105
106
  http = Net::HTTP.new(uri.host, uri.port)
106
107
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http-request
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-21 00:00:00.000000000 Z
12
+ date: 2012-06-08 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Simple HTTP client built with Net/HTTP
15
15
  email:
@@ -41,7 +41,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
41
41
  version: 1.3.6
42
42
  requirements: []
43
43
  rubyforge_project:
44
- rubygems_version: 1.8.17
44
+ rubygems_version: 1.8.23
45
45
  signing_key:
46
46
  specification_version: 3
47
47
  summary: Simple HTTP client built with Net/HTTP