typhoeus 0.1.29 → 0.1.30

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.
@@ -1,5 +1,6 @@
1
- In-Progress
1
+ 0.1.30
2
2
  -----------
3
+ * Exposed CURLOPT_CONNECTTIMEOUT_MS to Requests [balexis]
3
4
 
4
5
  0.1.29
5
6
  ------
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.29
1
+ 0.1.30
@@ -1,5 +1,5 @@
1
- require File.dirname(__FILE__) + '/../lib/typhoeus.rb'
2
1
  require 'rubygems'
2
+ require File.dirname(__FILE__) + '/../lib/typhoeus.rb'
3
3
  require 'json'
4
4
 
5
5
  class Twitter
@@ -16,6 +16,10 @@ module Typhoeus
16
16
  :CURLOPT_POSTFIELDSIZE => 60,
17
17
  :CURLOPT_USERAGENT => 10018,
18
18
  :CURLOPT_TIMEOUT_MS => 155,
19
+ # Time-out connect operations after this amount of milliseconds.
20
+ # [Only works on unix-style/SIGALRM operating systems. IOW, does
21
+ # not work on Windows.
22
+ :CURLOPT_CONNECTTIMEOUT_MS => 156,
19
23
  :CURLOPT_NOSIGNAL => 99,
20
24
  :CURLOPT_HTTPHEADER => 10023,
21
25
  :CURLOPT_FOLLOWLOCATION => 52,
@@ -100,6 +104,12 @@ module Typhoeus
100
104
  def max_redirects=(redirects)
101
105
  set_option(OPTION_VALUES[:CURLOPT_MAXREDIRS], redirects)
102
106
  end
107
+
108
+ def connect_timeout=(milliseconds)
109
+ @connect_timeout = milliseconds
110
+ set_option(OPTION_VALUES[:CURLOPT_NOSIGNAL], 1)
111
+ set_option(OPTION_VALUES[:CURLOPT_CONNECTTIMEOUT_MS], milliseconds)
112
+ end
103
113
 
104
114
  def timeout=(milliseconds)
105
115
  @timeout = milliseconds
@@ -138,6 +138,7 @@ module Typhoeus
138
138
  easy.headers = request.headers if request.headers
139
139
  easy.request_body = request.body if request.body
140
140
  easy.timeout = request.timeout if request.timeout
141
+ easy.connect_timeout = request.connect_timeout if request.connect_timeout
141
142
  easy.follow_location = request.follow_location if request.follow_location
142
143
  easy.max_redirects = request.max_redirects if request.max_redirects
143
144
  easy.proxy = request.proxy if request.proxy
@@ -1,7 +1,6 @@
1
1
  module Typhoeus
2
2
  class Request
3
- attr_accessor :method, :params, :body, :headers, :timeout, :user_agent, :response, :cache_timeout, :follow_location, :max_redirects, :proxy, :disable_ssl_peer_verification, :ssl_cert, :ssl_cert_type, :ssl_key, :ssl_key_type, :ssl_key_password, :ssl_cacert, :ssl_capath, :verbose
4
-
3
+ attr_accessor :method, :params, :body, :headers, :connect_timeout, :timeout, :user_agent, :response, :cache_timeout, :follow_location, :max_redirects, :proxy, :disable_ssl_peer_verification, :ssl_cert, :ssl_cert_type, :ssl_key, :ssl_key_type, :ssl_key_password, :ssl_cacert, :ssl_capath, :verbose
5
4
 
6
5
  attr_reader :url
7
6
 
@@ -14,6 +13,7 @@ module Typhoeus
14
13
  # ** +:params+ : params as a Hash
15
14
  # ** +:body+
16
15
  # ** +:timeout+ : timeout (ms)
16
+ # ** +:connect_timeout+ : connect timeout (ms)
17
17
  # ** +:headers+ : headers as Hash
18
18
  # ** +:user_agent+ : user agent (string)
19
19
  # ** +:cache_timeout+ : cache timeout (ms)
@@ -35,6 +35,7 @@ module Typhoeus
35
35
  @params = options[:params]
36
36
  @body = options[:body]
37
37
  @timeout = options[:timeout]
38
+ @connect_timeout = options[:connect_timeout]
38
39
  @headers = options[:headers] || {}
39
40
  @user_agent = options[:user_agent] || Typhoeus::USER_AGENT
40
41
  @cache_timeout = options[:cache_timeout]
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{typhoeus}
8
- s.version = "0.1.29"
8
+ s.version = "0.1.30"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Paul Dix"]
12
- s.date = %q{2010-07-05}
12
+ s.date = %q{2010-07-15}
13
13
  s.description = %q{Like a modern code version of the mythical beast with 100 serpent heads, Typhoeus runs HTTP requests in parallel while cleanly encapsulating handling logic.}
14
14
  s.email = %q{paul@pauldix.net}
15
15
  s.extensions = ["ext/typhoeus/extconf.rb"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 29
9
- version: 0.1.29
8
+ - 30
9
+ version: 0.1.30
10
10
  platform: ruby
11
11
  authors:
12
12
  - Paul Dix
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-05 00:00:00 -07:00
17
+ date: 2010-07-15 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency