typhoeus 0.1.28 → 0.1.29
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.markdown +8 -0
- data/README.textile +2 -2
- data/VERSION +1 -1
- data/lib/typhoeus/easy.rb +2 -2
- data/lib/typhoeus/hydra.rb +1 -0
- data/lib/typhoeus/multi.rb +1 -1
- data/lib/typhoeus/request.rb +3 -1
- data/typhoeus.gemspec +2 -2
- metadata +3 -3
data/CHANGELOG.markdown
CHANGED
data/README.textile
CHANGED
@@ -103,8 +103,8 @@ hydra.queue first_request
|
|
103
103
|
hydra.queue second_request
|
104
104
|
hydra.run # this is a blocking call that returns once all requests are complete
|
105
105
|
|
106
|
-
first_request.
|
107
|
-
second_request.
|
106
|
+
first_request.handled_response # the value returned from the on_complete block
|
107
|
+
second_request.handled_response # the value returned from the on_complete block (parsed JSON)
|
108
108
|
</pre>
|
109
109
|
|
110
110
|
The execution of that code goes something like this. The first and second requests are built and queued. When hydra is run the first and second requests run in parallel. When the first request completes, the third request is then built and queued up. The moment it is queued Hydra starts executing it. Meanwhile the second request would continue to run (or it could have completed before the first). Once the third request is done, hydra.run returns.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.29
|
data/lib/typhoeus/easy.rb
CHANGED
@@ -12,6 +12,7 @@ module Typhoeus
|
|
12
12
|
:CURLOPT_UPLOAD => 46,
|
13
13
|
:CURLOPT_CUSTOMREQUEST => 10036,
|
14
14
|
:CURLOPT_POSTFIELDS => 10015,
|
15
|
+
:CURLOPT_COPYPOSTFIELDS => 10165,
|
15
16
|
:CURLOPT_POSTFIELDSIZE => 60,
|
16
17
|
:CURLOPT_USERAGENT => 10018,
|
17
18
|
:CURLOPT_TIMEOUT_MS => 155,
|
@@ -50,7 +51,6 @@ module Typhoeus
|
|
50
51
|
|
51
52
|
def initialize
|
52
53
|
@method = :get
|
53
|
-
@post_dat_set = nil
|
54
54
|
@headers = {}
|
55
55
|
|
56
56
|
set_option(OPTION_VALUES[:CURLOPT_ENCODING], 'zlib') if supports_zlib?
|
@@ -158,8 +158,8 @@ module Typhoeus
|
|
158
158
|
|
159
159
|
def post_data=(data)
|
160
160
|
@post_data_set = true
|
161
|
-
set_option(OPTION_VALUES[:CURLOPT_POSTFIELDS], data)
|
162
161
|
set_option(OPTION_VALUES[:CURLOPT_POSTFIELDSIZE], data.length)
|
162
|
+
set_option(OPTION_VALUES[:CURLOPT_COPYPOSTFIELDS], data)
|
163
163
|
end
|
164
164
|
|
165
165
|
def params=(params)
|
data/lib/typhoeus/hydra.rb
CHANGED
data/lib/typhoeus/multi.rb
CHANGED
data/lib/typhoeus/request.rb
CHANGED
@@ -1,6 +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
|
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
4
|
|
5
5
|
|
6
6
|
attr_reader :url
|
@@ -28,6 +28,7 @@ module Typhoeus
|
|
28
28
|
# ** +:ssl_key_password
|
29
29
|
# ** +:ssl_cacert
|
30
30
|
# ** +:ssl_capath
|
31
|
+
# ** +:verbose
|
31
32
|
#
|
32
33
|
def initialize(url, options = {})
|
33
34
|
@method = options[:method] || :get
|
@@ -48,6 +49,7 @@ module Typhoeus
|
|
48
49
|
@ssl_key_password = options[:ssl_key_password]
|
49
50
|
@ssl_cacert = options[:ssl_cacert]
|
50
51
|
@ssl_capath = options[:ssl_capath]
|
52
|
+
@verbose = options[:verbose]
|
51
53
|
|
52
54
|
if @method == :post
|
53
55
|
@url = url
|
data/typhoeus.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{typhoeus}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.29"
|
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-
|
12
|
+
s.date = %q{2010-07-05}
|
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
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 29
|
9
|
+
version: 0.1.29
|
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-
|
17
|
+
date: 2010-07-05 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|