typhoeus 0.1.6 → 0.2.0
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.
- data/.gitignore +3 -0
- data/CHANGELOG.markdown +31 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +30 -0
- data/README.textile +333 -0
- data/Rakefile +38 -0
- data/VERSION +1 -0
- data/benchmarks/profile.rb +25 -0
- data/benchmarks/vs_nethttp.rb +35 -0
- data/examples/twitter.rb +21 -0
- data/ext/typhoeus/.gitignore +6 -0
- data/ext/typhoeus/extconf.rb +3 -2
- data/ext/typhoeus/native.h +7 -0
- data/ext/typhoeus/typhoeus_multi.c +1 -2
- data/lib/typhoeus/.gitignore +1 -0
- data/lib/typhoeus/easy.rb +172 -42
- data/lib/typhoeus/hydra/callbacks.rb +24 -0
- data/lib/typhoeus/hydra/connect_options.rb +45 -0
- data/lib/typhoeus/hydra/stubbing.rb +52 -0
- data/lib/typhoeus/hydra.rb +85 -59
- data/lib/typhoeus/hydra_mock.rb +131 -0
- data/lib/typhoeus/multi.rb +4 -3
- data/lib/typhoeus/normalized_header_hash.rb +58 -0
- data/lib/typhoeus/remote_proxy_object.rb +6 -6
- data/lib/typhoeus/request.rb +118 -31
- data/lib/typhoeus/response.rb +61 -4
- data/lib/typhoeus/service.rb +20 -0
- data/lib/typhoeus/utils.rb +24 -0
- data/lib/typhoeus.rb +11 -8
- data/profilers/valgrind.rb +24 -0
- data/spec/fixtures/result_set.xml +60 -0
- data/spec/servers/app.rb +48 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/typhoeus/easy_spec.rb +126 -4
- data/spec/typhoeus/hydra_mock_spec.rb +300 -0
- data/spec/typhoeus/hydra_spec.rb +456 -0
- data/spec/typhoeus/normalized_header_hash_spec.rb +41 -0
- data/spec/typhoeus/remote_spec.rb +2 -2
- data/spec/typhoeus/request_spec.rb +247 -0
- data/spec/typhoeus/response_spec.rb +104 -1
- data/spec/typhoeus/utils_spec.rb +22 -0
- data/typhoeus.gemspec +123 -0
- metadata +145 -34
- data/ext/typhoeus/Makefile +0 -157
metadata
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: typhoeus
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
|
|
4
|
+
hash: 23
|
|
5
|
+
prerelease: false
|
|
6
|
+
segments:
|
|
7
|
+
- 0
|
|
8
|
+
- 2
|
|
9
|
+
- 0
|
|
10
|
+
version: 0.2.0
|
|
5
11
|
platform: ruby
|
|
6
12
|
authors:
|
|
7
13
|
- Paul Dix
|
|
@@ -9,84 +15,189 @@ autorequire:
|
|
|
9
15
|
bindir: bin
|
|
10
16
|
cert_chain: []
|
|
11
17
|
|
|
12
|
-
date:
|
|
18
|
+
date: 2010-11-11 00:00:00 -08:00
|
|
13
19
|
default_executable:
|
|
14
20
|
dependencies:
|
|
15
21
|
- !ruby/object:Gem::Dependency
|
|
16
|
-
name:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
name: rspec
|
|
23
|
+
prerelease: false
|
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
|
25
|
+
none: false
|
|
20
26
|
requirements:
|
|
21
|
-
- - "
|
|
27
|
+
- - ">="
|
|
22
28
|
- !ruby/object:Gem::Version
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
hash: 3
|
|
30
|
+
segments:
|
|
31
|
+
- 0
|
|
32
|
+
version: "0"
|
|
33
|
+
type: :development
|
|
34
|
+
version_requirements: *id001
|
|
35
|
+
- !ruby/object:Gem::Dependency
|
|
36
|
+
name: jeweler
|
|
37
|
+
prerelease: false
|
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
|
39
|
+
none: false
|
|
40
|
+
requirements:
|
|
41
|
+
- - ">="
|
|
42
|
+
- !ruby/object:Gem::Version
|
|
43
|
+
hash: 3
|
|
44
|
+
segments:
|
|
45
|
+
- 0
|
|
46
|
+
version: "0"
|
|
47
|
+
type: :development
|
|
48
|
+
version_requirements: *id002
|
|
49
|
+
- !ruby/object:Gem::Dependency
|
|
50
|
+
name: diff-lcs
|
|
51
|
+
prerelease: false
|
|
52
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
|
53
|
+
none: false
|
|
54
|
+
requirements:
|
|
55
|
+
- - ">="
|
|
56
|
+
- !ruby/object:Gem::Version
|
|
57
|
+
hash: 3
|
|
58
|
+
segments:
|
|
59
|
+
- 0
|
|
60
|
+
version: "0"
|
|
61
|
+
type: :development
|
|
62
|
+
version_requirements: *id003
|
|
63
|
+
- !ruby/object:Gem::Dependency
|
|
64
|
+
name: sinatra
|
|
65
|
+
prerelease: false
|
|
66
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
|
67
|
+
none: false
|
|
68
|
+
requirements:
|
|
69
|
+
- - ">="
|
|
70
|
+
- !ruby/object:Gem::Version
|
|
71
|
+
hash: 3
|
|
72
|
+
segments:
|
|
73
|
+
- 0
|
|
74
|
+
version: "0"
|
|
75
|
+
type: :development
|
|
76
|
+
version_requirements: *id004
|
|
77
|
+
- !ruby/object:Gem::Dependency
|
|
78
|
+
name: json
|
|
79
|
+
prerelease: false
|
|
80
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
|
81
|
+
none: false
|
|
82
|
+
requirements:
|
|
83
|
+
- - ">="
|
|
84
|
+
- !ruby/object:Gem::Version
|
|
85
|
+
hash: 3
|
|
86
|
+
segments:
|
|
87
|
+
- 0
|
|
88
|
+
version: "0"
|
|
89
|
+
type: :development
|
|
90
|
+
version_requirements: *id005
|
|
91
|
+
description: Like a modern code version of the mythical beast with 100 serpent heads, Typhoeus runs HTTP requests in parallel while cleanly encapsulating handling logic.
|
|
26
92
|
email: paul@pauldix.net
|
|
27
93
|
executables: []
|
|
28
94
|
|
|
29
95
|
extensions:
|
|
30
96
|
- ext/typhoeus/extconf.rb
|
|
31
|
-
extra_rdoc_files:
|
|
32
|
-
|
|
97
|
+
extra_rdoc_files:
|
|
98
|
+
- README.textile
|
|
33
99
|
files:
|
|
100
|
+
- .gitignore
|
|
101
|
+
- CHANGELOG.markdown
|
|
102
|
+
- Gemfile
|
|
103
|
+
- Gemfile.lock
|
|
104
|
+
- README.textile
|
|
105
|
+
- Rakefile
|
|
106
|
+
- VERSION
|
|
107
|
+
- benchmarks/profile.rb
|
|
108
|
+
- benchmarks/vs_nethttp.rb
|
|
109
|
+
- examples/twitter.rb
|
|
110
|
+
- ext/typhoeus/.gitignore
|
|
34
111
|
- ext/typhoeus/extconf.rb
|
|
35
|
-
- ext/typhoeus/
|
|
112
|
+
- ext/typhoeus/native.c
|
|
113
|
+
- ext/typhoeus/native.h
|
|
36
114
|
- ext/typhoeus/typhoeus_easy.c
|
|
37
|
-
- ext/typhoeus/
|
|
115
|
+
- ext/typhoeus/typhoeus_easy.h
|
|
38
116
|
- ext/typhoeus/typhoeus_multi.c
|
|
39
|
-
- ext/typhoeus/
|
|
40
|
-
- ext/typhoeus/native.h
|
|
41
|
-
- ext/typhoeus/native.c
|
|
117
|
+
- ext/typhoeus/typhoeus_multi.h
|
|
42
118
|
- lib/typhoeus.rb
|
|
119
|
+
- lib/typhoeus/.gitignore
|
|
43
120
|
- lib/typhoeus/easy.rb
|
|
121
|
+
- lib/typhoeus/filter.rb
|
|
122
|
+
- lib/typhoeus/hydra.rb
|
|
123
|
+
- lib/typhoeus/hydra/callbacks.rb
|
|
124
|
+
- lib/typhoeus/hydra/connect_options.rb
|
|
125
|
+
- lib/typhoeus/hydra/stubbing.rb
|
|
126
|
+
- lib/typhoeus/hydra_mock.rb
|
|
44
127
|
- lib/typhoeus/multi.rb
|
|
128
|
+
- lib/typhoeus/normalized_header_hash.rb
|
|
45
129
|
- lib/typhoeus/remote.rb
|
|
46
|
-
- lib/typhoeus/remote_proxy_object.rb
|
|
47
|
-
- lib/typhoeus/filter.rb
|
|
48
130
|
- lib/typhoeus/remote_method.rb
|
|
49
|
-
- lib/typhoeus/
|
|
50
|
-
- lib/typhoeus/hydra.rb
|
|
131
|
+
- lib/typhoeus/remote_proxy_object.rb
|
|
51
132
|
- lib/typhoeus/request.rb
|
|
133
|
+
- lib/typhoeus/response.rb
|
|
134
|
+
- lib/typhoeus/service.rb
|
|
135
|
+
- lib/typhoeus/utils.rb
|
|
136
|
+
- profilers/valgrind.rb
|
|
137
|
+
- spec/fixtures/result_set.xml
|
|
138
|
+
- spec/servers/app.rb
|
|
52
139
|
- spec/spec.opts
|
|
53
140
|
- spec/spec_helper.rb
|
|
54
141
|
- spec/typhoeus/easy_spec.rb
|
|
55
|
-
- spec/typhoeus/multi_spec.rb
|
|
56
|
-
- spec/typhoeus/remote_spec.rb
|
|
57
|
-
- spec/typhoeus/remote_proxy_object_spec.rb
|
|
58
142
|
- spec/typhoeus/filter_spec.rb
|
|
143
|
+
- spec/typhoeus/hydra_mock_spec.rb
|
|
144
|
+
- spec/typhoeus/hydra_spec.rb
|
|
145
|
+
- spec/typhoeus/multi_spec.rb
|
|
146
|
+
- spec/typhoeus/normalized_header_hash_spec.rb
|
|
59
147
|
- spec/typhoeus/remote_method_spec.rb
|
|
148
|
+
- spec/typhoeus/remote_proxy_object_spec.rb
|
|
149
|
+
- spec/typhoeus/remote_spec.rb
|
|
150
|
+
- spec/typhoeus/request_spec.rb
|
|
60
151
|
- spec/typhoeus/response_spec.rb
|
|
61
|
-
- spec/
|
|
152
|
+
- spec/typhoeus/utils_spec.rb
|
|
153
|
+
- typhoeus.gemspec
|
|
62
154
|
has_rdoc: true
|
|
63
155
|
homepage: http://github.com/pauldix/typhoeus
|
|
64
156
|
licenses: []
|
|
65
157
|
|
|
66
158
|
post_install_message:
|
|
67
|
-
rdoc_options:
|
|
68
|
-
|
|
159
|
+
rdoc_options:
|
|
160
|
+
- --charset=UTF-8
|
|
69
161
|
require_paths:
|
|
70
162
|
- lib
|
|
71
|
-
- ext
|
|
72
163
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
164
|
+
none: false
|
|
73
165
|
requirements:
|
|
74
166
|
- - ">="
|
|
75
167
|
- !ruby/object:Gem::Version
|
|
168
|
+
hash: 3
|
|
169
|
+
segments:
|
|
170
|
+
- 0
|
|
76
171
|
version: "0"
|
|
77
|
-
version:
|
|
78
172
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
|
+
none: false
|
|
79
174
|
requirements:
|
|
80
175
|
- - ">="
|
|
81
176
|
- !ruby/object:Gem::Version
|
|
177
|
+
hash: 3
|
|
178
|
+
segments:
|
|
179
|
+
- 0
|
|
82
180
|
version: "0"
|
|
83
|
-
version:
|
|
84
181
|
requirements: []
|
|
85
182
|
|
|
86
183
|
rubyforge_project:
|
|
87
|
-
rubygems_version: 1.3.
|
|
184
|
+
rubygems_version: 1.3.7
|
|
88
185
|
signing_key:
|
|
89
|
-
specification_version:
|
|
186
|
+
specification_version: 3
|
|
90
187
|
summary: A library for interacting with web services (and building SOAs) at blinding speed.
|
|
91
|
-
test_files:
|
|
92
|
-
|
|
188
|
+
test_files:
|
|
189
|
+
- spec/servers/app.rb
|
|
190
|
+
- spec/spec_helper.rb
|
|
191
|
+
- spec/typhoeus/easy_spec.rb
|
|
192
|
+
- spec/typhoeus/filter_spec.rb
|
|
193
|
+
- spec/typhoeus/hydra_mock_spec.rb
|
|
194
|
+
- spec/typhoeus/hydra_spec.rb
|
|
195
|
+
- spec/typhoeus/multi_spec.rb
|
|
196
|
+
- spec/typhoeus/normalized_header_hash_spec.rb
|
|
197
|
+
- spec/typhoeus/remote_method_spec.rb
|
|
198
|
+
- spec/typhoeus/remote_proxy_object_spec.rb
|
|
199
|
+
- spec/typhoeus/remote_spec.rb
|
|
200
|
+
- spec/typhoeus/request_spec.rb
|
|
201
|
+
- spec/typhoeus/response_spec.rb
|
|
202
|
+
- spec/typhoeus/utils_spec.rb
|
|
203
|
+
- examples/twitter.rb
|
data/ext/typhoeus/Makefile
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
SHELL = /bin/sh
|
|
3
|
-
|
|
4
|
-
#### Start of system configuration section. ####
|
|
5
|
-
|
|
6
|
-
srcdir = .
|
|
7
|
-
topdir = /usr/local/lib/ruby/1.8/i686-darwin9.6.0
|
|
8
|
-
hdrdir = $(topdir)
|
|
9
|
-
VPATH = $(srcdir):$(topdir):$(hdrdir)
|
|
10
|
-
exec_prefix = $(prefix)
|
|
11
|
-
prefix = $(DESTDIR)/usr/local
|
|
12
|
-
sharedstatedir = $(prefix)/com
|
|
13
|
-
mandir = $(datarootdir)/man
|
|
14
|
-
psdir = $(docdir)
|
|
15
|
-
oldincludedir = $(DESTDIR)/usr/include
|
|
16
|
-
localedir = $(datarootdir)/locale
|
|
17
|
-
bindir = $(exec_prefix)/bin
|
|
18
|
-
libexecdir = $(exec_prefix)/libexec
|
|
19
|
-
sitedir = $(libdir)/ruby/site_ruby
|
|
20
|
-
htmldir = $(docdir)
|
|
21
|
-
vendorarchdir = $(vendorlibdir)/$(sitearch)
|
|
22
|
-
includedir = $(prefix)/include
|
|
23
|
-
infodir = $(datarootdir)/info
|
|
24
|
-
vendorlibdir = $(vendordir)/$(ruby_version)
|
|
25
|
-
sysconfdir = $(prefix)/etc
|
|
26
|
-
libdir = $(exec_prefix)/lib
|
|
27
|
-
sbindir = $(exec_prefix)/sbin
|
|
28
|
-
rubylibdir = $(libdir)/ruby/$(ruby_version)
|
|
29
|
-
docdir = $(datarootdir)/doc/$(PACKAGE)
|
|
30
|
-
dvidir = $(docdir)
|
|
31
|
-
vendordir = $(libdir)/ruby/vendor_ruby
|
|
32
|
-
datarootdir = $(prefix)/share
|
|
33
|
-
pdfdir = $(docdir)
|
|
34
|
-
archdir = $(rubylibdir)/$(arch)
|
|
35
|
-
sitearchdir = $(sitelibdir)/$(sitearch)
|
|
36
|
-
datadir = $(datarootdir)
|
|
37
|
-
localstatedir = $(prefix)/var
|
|
38
|
-
sitelibdir = $(sitedir)/$(ruby_version)
|
|
39
|
-
|
|
40
|
-
CC = gcc
|
|
41
|
-
LIBRUBY = $(LIBRUBY_A)
|
|
42
|
-
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
|
43
|
-
LIBRUBYARG_SHARED =
|
|
44
|
-
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
|
|
45
|
-
|
|
46
|
-
RUBY_EXTCONF_H =
|
|
47
|
-
CFLAGS = -fno-common -g -O2 -pipe -fno-common $(cflags) -g -DXP_UNIX -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline
|
|
48
|
-
INCFLAGS = -I. -I. -I/usr/local/lib/ruby/1.8/i686-darwin9.6.0 -I.
|
|
49
|
-
DEFS =
|
|
50
|
-
CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE
|
|
51
|
-
CXXFLAGS = $(CFLAGS)
|
|
52
|
-
ldflags = -L.
|
|
53
|
-
dldflags =
|
|
54
|
-
archflag =
|
|
55
|
-
DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
|
|
56
|
-
LDSHARED = cc -dynamic -bundle -undefined suppress -flat_namespace
|
|
57
|
-
AR = ar
|
|
58
|
-
EXEEXT =
|
|
59
|
-
|
|
60
|
-
RUBY_INSTALL_NAME = ruby
|
|
61
|
-
RUBY_SO_NAME = ruby
|
|
62
|
-
arch = i686-darwin9.6.0
|
|
63
|
-
sitearch = i686-darwin9.6.0
|
|
64
|
-
ruby_version = 1.8
|
|
65
|
-
ruby = /usr/local/bin/ruby
|
|
66
|
-
RUBY = $(ruby)
|
|
67
|
-
RM = rm -f
|
|
68
|
-
MAKEDIRS = mkdir -p
|
|
69
|
-
INSTALL = /usr/bin/install -c
|
|
70
|
-
INSTALL_PROG = $(INSTALL) -m 0755
|
|
71
|
-
INSTALL_DATA = $(INSTALL) -m 644
|
|
72
|
-
COPY = cp
|
|
73
|
-
|
|
74
|
-
#### End of system configuration section. ####
|
|
75
|
-
|
|
76
|
-
preload =
|
|
77
|
-
|
|
78
|
-
libpath = . $(libdir) /opt/local/lib
|
|
79
|
-
LIBPATH = -L. -L$(libdir) -L/opt/local/lib
|
|
80
|
-
DEFFILE =
|
|
81
|
-
|
|
82
|
-
CLEANFILES = mkmf.log
|
|
83
|
-
DISTCLEANFILES =
|
|
84
|
-
|
|
85
|
-
extout =
|
|
86
|
-
extout_prefix =
|
|
87
|
-
target_prefix = /typhoeus
|
|
88
|
-
LOCAL_LIBS =
|
|
89
|
-
LIBS = -lcurl -ldl -lobjc
|
|
90
|
-
SRCS = native.c typhoeus_easy.c typhoeus_multi.c
|
|
91
|
-
OBJS = native.o typhoeus_easy.o typhoeus_multi.o
|
|
92
|
-
TARGET = native
|
|
93
|
-
DLLIB = $(TARGET).bundle
|
|
94
|
-
EXTSTATIC =
|
|
95
|
-
STATIC_LIB =
|
|
96
|
-
|
|
97
|
-
BINDIR = $(bindir)
|
|
98
|
-
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
|
|
99
|
-
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
|
100
|
-
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
|
101
|
-
|
|
102
|
-
TARGET_SO = $(DLLIB)
|
|
103
|
-
CLEANLIBS = $(TARGET).bundle $(TARGET).il? $(TARGET).tds $(TARGET).map
|
|
104
|
-
CLEANOBJS = *.o *.a *.s[ol] *.pdb *.exp *.bak
|
|
105
|
-
|
|
106
|
-
all: $(DLLIB)
|
|
107
|
-
static: $(STATIC_LIB)
|
|
108
|
-
|
|
109
|
-
clean:
|
|
110
|
-
@-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
|
|
111
|
-
|
|
112
|
-
distclean: clean
|
|
113
|
-
@-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
|
|
114
|
-
@-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
|
|
115
|
-
|
|
116
|
-
realclean: distclean
|
|
117
|
-
install: install-so install-rb
|
|
118
|
-
|
|
119
|
-
install-so: $(RUBYARCHDIR)
|
|
120
|
-
install-so: $(RUBYARCHDIR)/$(DLLIB)
|
|
121
|
-
$(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
|
|
122
|
-
$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
|
|
123
|
-
install-rb: pre-install-rb install-rb-default
|
|
124
|
-
install-rb-default: pre-install-rb-default
|
|
125
|
-
pre-install-rb: Makefile
|
|
126
|
-
pre-install-rb-default: Makefile
|
|
127
|
-
$(RUBYARCHDIR):
|
|
128
|
-
$(MAKEDIRS) $@
|
|
129
|
-
|
|
130
|
-
site-install: site-install-so site-install-rb
|
|
131
|
-
site-install-so: install-so
|
|
132
|
-
site-install-rb: install-rb
|
|
133
|
-
|
|
134
|
-
.SUFFIXES: .c .m .cc .cxx .cpp .C .o
|
|
135
|
-
|
|
136
|
-
.cc.o:
|
|
137
|
-
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
|
138
|
-
|
|
139
|
-
.cxx.o:
|
|
140
|
-
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
|
141
|
-
|
|
142
|
-
.cpp.o:
|
|
143
|
-
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
|
144
|
-
|
|
145
|
-
.C.o:
|
|
146
|
-
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
|
147
|
-
|
|
148
|
-
.c.o:
|
|
149
|
-
$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $<
|
|
150
|
-
|
|
151
|
-
$(DLLIB): $(OBJS)
|
|
152
|
-
@-$(RM) $@
|
|
153
|
-
$(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
$(OBJS): ruby.h defines.h
|