typhoeus 0.1.31 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,22 @@
1
+ require File.dirname(__FILE__) + "/../spec_helper"
2
+
3
+ describe Typhoeus::Utils do
4
+ # Taken from Rack 1.2.1
5
+ describe "#escape" do
6
+ it "should escape correctly" do
7
+ Typhoeus::Utils.escape("fo<o>bar").should == "fo%3Co%3Ebar"
8
+ Typhoeus::Utils.escape("a space").should == "a+space"
9
+ Typhoeus::Utils.escape("q1!2\"'w$5&7/z8)?\\").
10
+ should == "q1%212%22%27w%245%267%2Fz8%29%3F%5C"
11
+ end
12
+
13
+ it "should escape correctly for multibyte characters" do
14
+ matz_name = "\xE3\x81\xBE\xE3\x81\xA4\xE3\x82\x82\xE3\x81\xA8".unpack("a*")[0] # Matsumoto
15
+ matz_name.force_encoding("UTF-8") if matz_name.respond_to? :force_encoding
16
+ Typhoeus::Utils.escape(matz_name).should == '%E3%81%BE%E3%81%A4%E3%82%82%E3%81%A8'
17
+ matz_name_sep = "\xE3\x81\xBE\xE3\x81\xA4 \xE3\x82\x82\xE3\x81\xA8".unpack("a*")[0] # Matsu moto
18
+ matz_name_sep.force_encoding("UTF-8") if matz_name_sep.respond_to? :force_encoding
19
+ Typhoeus::Utils.escape(matz_name_sep).should == '%E3%81%BE%E3%81%A4+%E3%82%82%E3%81%A8'
20
+ end
21
+ end
22
+ end
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.31"
8
+ s.version = "0.2.0"
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-16}
12
+ s.date = %q{2010-11-11}
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"]
@@ -19,6 +19,8 @@ Gem::Specification.new do |s|
19
19
  s.files = [
20
20
  ".gitignore",
21
21
  "CHANGELOG.markdown",
22
+ "Gemfile",
23
+ "Gemfile.lock",
22
24
  "README.textile",
23
25
  "Rakefile",
24
26
  "VERSION",
@@ -26,7 +28,6 @@ Gem::Specification.new do |s|
26
28
  "benchmarks/vs_nethttp.rb",
27
29
  "examples/twitter.rb",
28
30
  "ext/typhoeus/.gitignore",
29
- "ext/typhoeus/Makefile",
30
31
  "ext/typhoeus/extconf.rb",
31
32
  "ext/typhoeus/native.c",
32
33
  "ext/typhoeus/native.h",
@@ -39,13 +40,19 @@ Gem::Specification.new do |s|
39
40
  "lib/typhoeus/easy.rb",
40
41
  "lib/typhoeus/filter.rb",
41
42
  "lib/typhoeus/hydra.rb",
43
+ "lib/typhoeus/hydra/callbacks.rb",
44
+ "lib/typhoeus/hydra/connect_options.rb",
45
+ "lib/typhoeus/hydra/stubbing.rb",
46
+ "lib/typhoeus/hydra_mock.rb",
42
47
  "lib/typhoeus/multi.rb",
48
+ "lib/typhoeus/normalized_header_hash.rb",
43
49
  "lib/typhoeus/remote.rb",
44
50
  "lib/typhoeus/remote_method.rb",
45
51
  "lib/typhoeus/remote_proxy_object.rb",
46
52
  "lib/typhoeus/request.rb",
47
53
  "lib/typhoeus/response.rb",
48
54
  "lib/typhoeus/service.rb",
55
+ "lib/typhoeus/utils.rb",
49
56
  "profilers/valgrind.rb",
50
57
  "spec/fixtures/result_set.xml",
51
58
  "spec/servers/app.rb",
@@ -53,32 +60,38 @@ Gem::Specification.new do |s|
53
60
  "spec/spec_helper.rb",
54
61
  "spec/typhoeus/easy_spec.rb",
55
62
  "spec/typhoeus/filter_spec.rb",
63
+ "spec/typhoeus/hydra_mock_spec.rb",
56
64
  "spec/typhoeus/hydra_spec.rb",
57
65
  "spec/typhoeus/multi_spec.rb",
66
+ "spec/typhoeus/normalized_header_hash_spec.rb",
58
67
  "spec/typhoeus/remote_method_spec.rb",
59
68
  "spec/typhoeus/remote_proxy_object_spec.rb",
60
69
  "spec/typhoeus/remote_spec.rb",
61
70
  "spec/typhoeus/request_spec.rb",
62
71
  "spec/typhoeus/response_spec.rb",
72
+ "spec/typhoeus/utils_spec.rb",
63
73
  "typhoeus.gemspec"
64
74
  ]
65
75
  s.homepage = %q{http://github.com/pauldix/typhoeus}
66
76
  s.rdoc_options = ["--charset=UTF-8"]
67
77
  s.require_paths = ["lib"]
68
- s.rubygems_version = %q{1.3.6}
78
+ s.rubygems_version = %q{1.3.7}
69
79
  s.summary = %q{A library for interacting with web services (and building SOAs) at blinding speed.}
70
80
  s.test_files = [
71
81
  "spec/servers/app.rb",
72
82
  "spec/spec_helper.rb",
73
83
  "spec/typhoeus/easy_spec.rb",
74
84
  "spec/typhoeus/filter_spec.rb",
85
+ "spec/typhoeus/hydra_mock_spec.rb",
75
86
  "spec/typhoeus/hydra_spec.rb",
76
87
  "spec/typhoeus/multi_spec.rb",
88
+ "spec/typhoeus/normalized_header_hash_spec.rb",
77
89
  "spec/typhoeus/remote_method_spec.rb",
78
90
  "spec/typhoeus/remote_proxy_object_spec.rb",
79
91
  "spec/typhoeus/remote_spec.rb",
80
92
  "spec/typhoeus/request_spec.rb",
81
93
  "spec/typhoeus/response_spec.rb",
94
+ "spec/typhoeus/utils_spec.rb",
82
95
  "examples/twitter.rb"
83
96
  ]
84
97
 
@@ -86,15 +99,13 @@ Gem::Specification.new do |s|
86
99
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
87
100
  s.specification_version = 3
88
101
 
89
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
90
- s.add_runtime_dependency(%q<rack>, [">= 0"])
102
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
91
103
  s.add_development_dependency(%q<rspec>, [">= 0"])
92
104
  s.add_development_dependency(%q<jeweler>, [">= 0"])
93
105
  s.add_development_dependency(%q<diff-lcs>, [">= 0"])
94
106
  s.add_development_dependency(%q<sinatra>, [">= 0"])
95
107
  s.add_development_dependency(%q<json>, [">= 0"])
96
108
  else
97
- s.add_dependency(%q<rack>, [">= 0"])
98
109
  s.add_dependency(%q<rspec>, [">= 0"])
99
110
  s.add_dependency(%q<jeweler>, [">= 0"])
100
111
  s.add_dependency(%q<diff-lcs>, [">= 0"])
@@ -102,7 +113,6 @@ Gem::Specification.new do |s|
102
113
  s.add_dependency(%q<json>, [">= 0"])
103
114
  end
104
115
  else
105
- s.add_dependency(%q<rack>, [">= 0"])
106
116
  s.add_dependency(%q<rspec>, [">= 0"])
107
117
  s.add_dependency(%q<jeweler>, [">= 0"])
108
118
  s.add_dependency(%q<diff-lcs>, [">= 0"])
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: typhoeus
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 23
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
- - 1
8
- - 31
9
- version: 0.1.31
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
10
11
  platform: ruby
11
12
  authors:
12
13
  - Paul Dix
@@ -14,81 +15,79 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-07-16 00:00:00 -07:00
18
+ date: 2010-11-11 00:00:00 -08:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
- name: rack
22
+ name: rspec
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 3
27
30
  segments:
28
31
  - 0
29
32
  version: "0"
30
- type: :runtime
33
+ type: :development
31
34
  version_requirements: *id001
32
35
  - !ruby/object:Gem::Dependency
33
- name: rspec
36
+ name: jeweler
34
37
  prerelease: false
35
38
  requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
36
40
  requirements:
37
41
  - - ">="
38
42
  - !ruby/object:Gem::Version
43
+ hash: 3
39
44
  segments:
40
45
  - 0
41
46
  version: "0"
42
47
  type: :development
43
48
  version_requirements: *id002
44
49
  - !ruby/object:Gem::Dependency
45
- name: jeweler
50
+ name: diff-lcs
46
51
  prerelease: false
47
52
  requirement: &id003 !ruby/object:Gem::Requirement
53
+ none: false
48
54
  requirements:
49
55
  - - ">="
50
56
  - !ruby/object:Gem::Version
57
+ hash: 3
51
58
  segments:
52
59
  - 0
53
60
  version: "0"
54
61
  type: :development
55
62
  version_requirements: *id003
56
63
  - !ruby/object:Gem::Dependency
57
- name: diff-lcs
64
+ name: sinatra
58
65
  prerelease: false
59
66
  requirement: &id004 !ruby/object:Gem::Requirement
67
+ none: false
60
68
  requirements:
61
69
  - - ">="
62
70
  - !ruby/object:Gem::Version
71
+ hash: 3
63
72
  segments:
64
73
  - 0
65
74
  version: "0"
66
75
  type: :development
67
76
  version_requirements: *id004
68
77
  - !ruby/object:Gem::Dependency
69
- name: sinatra
78
+ name: json
70
79
  prerelease: false
71
80
  requirement: &id005 !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
83
  - - ">="
74
84
  - !ruby/object:Gem::Version
85
+ hash: 3
75
86
  segments:
76
87
  - 0
77
88
  version: "0"
78
89
  type: :development
79
90
  version_requirements: *id005
80
- - !ruby/object:Gem::Dependency
81
- name: json
82
- prerelease: false
83
- requirement: &id006 !ruby/object:Gem::Requirement
84
- requirements:
85
- - - ">="
86
- - !ruby/object:Gem::Version
87
- segments:
88
- - 0
89
- version: "0"
90
- type: :development
91
- version_requirements: *id006
92
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.
93
92
  email: paul@pauldix.net
94
93
  executables: []
@@ -100,6 +99,8 @@ extra_rdoc_files:
100
99
  files:
101
100
  - .gitignore
102
101
  - CHANGELOG.markdown
102
+ - Gemfile
103
+ - Gemfile.lock
103
104
  - README.textile
104
105
  - Rakefile
105
106
  - VERSION
@@ -107,7 +108,6 @@ files:
107
108
  - benchmarks/vs_nethttp.rb
108
109
  - examples/twitter.rb
109
110
  - ext/typhoeus/.gitignore
110
- - ext/typhoeus/Makefile
111
111
  - ext/typhoeus/extconf.rb
112
112
  - ext/typhoeus/native.c
113
113
  - ext/typhoeus/native.h
@@ -120,13 +120,19 @@ files:
120
120
  - lib/typhoeus/easy.rb
121
121
  - lib/typhoeus/filter.rb
122
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
123
127
  - lib/typhoeus/multi.rb
128
+ - lib/typhoeus/normalized_header_hash.rb
124
129
  - lib/typhoeus/remote.rb
125
130
  - lib/typhoeus/remote_method.rb
126
131
  - lib/typhoeus/remote_proxy_object.rb
127
132
  - lib/typhoeus/request.rb
128
133
  - lib/typhoeus/response.rb
129
134
  - lib/typhoeus/service.rb
135
+ - lib/typhoeus/utils.rb
130
136
  - profilers/valgrind.rb
131
137
  - spec/fixtures/result_set.xml
132
138
  - spec/servers/app.rb
@@ -134,13 +140,16 @@ files:
134
140
  - spec/spec_helper.rb
135
141
  - spec/typhoeus/easy_spec.rb
136
142
  - spec/typhoeus/filter_spec.rb
143
+ - spec/typhoeus/hydra_mock_spec.rb
137
144
  - spec/typhoeus/hydra_spec.rb
138
145
  - spec/typhoeus/multi_spec.rb
146
+ - spec/typhoeus/normalized_header_hash_spec.rb
139
147
  - spec/typhoeus/remote_method_spec.rb
140
148
  - spec/typhoeus/remote_proxy_object_spec.rb
141
149
  - spec/typhoeus/remote_spec.rb
142
150
  - spec/typhoeus/request_spec.rb
143
151
  - spec/typhoeus/response_spec.rb
152
+ - spec/typhoeus/utils_spec.rb
144
153
  - typhoeus.gemspec
145
154
  has_rdoc: true
146
155
  homepage: http://github.com/pauldix/typhoeus
@@ -152,23 +161,27 @@ rdoc_options:
152
161
  require_paths:
153
162
  - lib
154
163
  required_ruby_version: !ruby/object:Gem::Requirement
164
+ none: false
155
165
  requirements:
156
166
  - - ">="
157
167
  - !ruby/object:Gem::Version
168
+ hash: 3
158
169
  segments:
159
170
  - 0
160
171
  version: "0"
161
172
  required_rubygems_version: !ruby/object:Gem::Requirement
173
+ none: false
162
174
  requirements:
163
175
  - - ">="
164
176
  - !ruby/object:Gem::Version
177
+ hash: 3
165
178
  segments:
166
179
  - 0
167
180
  version: "0"
168
181
  requirements: []
169
182
 
170
183
  rubyforge_project:
171
- rubygems_version: 1.3.6
184
+ rubygems_version: 1.3.7
172
185
  signing_key:
173
186
  specification_version: 3
174
187
  summary: A library for interacting with web services (and building SOAs) at blinding speed.
@@ -177,11 +190,14 @@ test_files:
177
190
  - spec/spec_helper.rb
178
191
  - spec/typhoeus/easy_spec.rb
179
192
  - spec/typhoeus/filter_spec.rb
193
+ - spec/typhoeus/hydra_mock_spec.rb
180
194
  - spec/typhoeus/hydra_spec.rb
181
195
  - spec/typhoeus/multi_spec.rb
196
+ - spec/typhoeus/normalized_header_hash_spec.rb
182
197
  - spec/typhoeus/remote_method_spec.rb
183
198
  - spec/typhoeus/remote_proxy_object_spec.rb
184
199
  - spec/typhoeus/remote_spec.rb
185
200
  - spec/typhoeus/request_spec.rb
186
201
  - spec/typhoeus/response_spec.rb
202
+ - spec/typhoeus/utils_spec.rb
187
203
  - examples/twitter.rb
@@ -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