xenda-typhoeus 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. data/.gitignore +4 -0
  2. data/CHANGELOG.markdown +70 -0
  3. data/Gemfile +3 -0
  4. data/Gemfile.lock +38 -0
  5. data/LICENSE +20 -0
  6. data/README.textile +397 -0
  7. data/Rakefile +56 -0
  8. data/VERSION +1 -0
  9. data/benchmarks/profile.rb +25 -0
  10. data/benchmarks/vs_nethttp.rb +35 -0
  11. data/examples/file.rb +12 -0
  12. data/examples/times.rb +40 -0
  13. data/examples/twitter.rb +21 -0
  14. data/ext/typhoeus/.gitignore +7 -0
  15. data/ext/typhoeus/extconf.rb +65 -0
  16. data/ext/typhoeus/native.c +12 -0
  17. data/ext/typhoeus/native.h +22 -0
  18. data/ext/typhoeus/typhoeus_easy.c +232 -0
  19. data/ext/typhoeus/typhoeus_easy.h +20 -0
  20. data/ext/typhoeus/typhoeus_form.c +59 -0
  21. data/ext/typhoeus/typhoeus_form.h +13 -0
  22. data/ext/typhoeus/typhoeus_multi.c +217 -0
  23. data/ext/typhoeus/typhoeus_multi.h +16 -0
  24. data/lib/typhoeus.rb +58 -0
  25. data/lib/typhoeus/.gitignore +1 -0
  26. data/lib/typhoeus/easy.rb +379 -0
  27. data/lib/typhoeus/filter.rb +28 -0
  28. data/lib/typhoeus/form.rb +32 -0
  29. data/lib/typhoeus/hydra.rb +247 -0
  30. data/lib/typhoeus/hydra/callbacks.rb +24 -0
  31. data/lib/typhoeus/hydra/connect_options.rb +61 -0
  32. data/lib/typhoeus/hydra/stubbing.rb +52 -0
  33. data/lib/typhoeus/hydra_mock.rb +131 -0
  34. data/lib/typhoeus/multi.rb +37 -0
  35. data/lib/typhoeus/normalized_header_hash.rb +58 -0
  36. data/lib/typhoeus/remote.rb +306 -0
  37. data/lib/typhoeus/remote_method.rb +108 -0
  38. data/lib/typhoeus/remote_proxy_object.rb +50 -0
  39. data/lib/typhoeus/request.rb +203 -0
  40. data/lib/typhoeus/response.rb +91 -0
  41. data/lib/typhoeus/service.rb +20 -0
  42. data/lib/typhoeus/utils.rb +63 -0
  43. data/profilers/valgrind.rb +24 -0
  44. data/spec/fixtures/placeholder.gif +0 -0
  45. data/spec/fixtures/placeholder.txt +1 -0
  46. data/spec/fixtures/placeholder.ukn +0 -0
  47. data/spec/fixtures/result_set.xml +60 -0
  48. data/spec/servers/app.rb +94 -0
  49. data/spec/spec.opts +3 -0
  50. data/spec/spec_helper.rb +14 -0
  51. data/spec/typhoeus/easy_spec.rb +343 -0
  52. data/spec/typhoeus/filter_spec.rb +35 -0
  53. data/spec/typhoeus/form_spec.rb +117 -0
  54. data/spec/typhoeus/hydra_mock_spec.rb +300 -0
  55. data/spec/typhoeus/hydra_spec.rb +574 -0
  56. data/spec/typhoeus/multi_spec.rb +74 -0
  57. data/spec/typhoeus/normalized_header_hash_spec.rb +41 -0
  58. data/spec/typhoeus/remote_method_spec.rb +141 -0
  59. data/spec/typhoeus/remote_proxy_object_spec.rb +65 -0
  60. data/spec/typhoeus/remote_spec.rb +695 -0
  61. data/spec/typhoeus/request_spec.rb +300 -0
  62. data/spec/typhoeus/response_spec.rb +151 -0
  63. data/spec/typhoeus/utils_spec.rb +22 -0
  64. data/xenda-typhoeus.gemspec +139 -0
  65. metadata +203 -0
@@ -0,0 +1,22 @@
1
+ require File.expand_path(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
@@ -0,0 +1,139 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{xenda-typhoeus}
8
+ s.version = "0.2.4"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Paul Dix", "David Balatero"]
12
+ s.date = %q{2011-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
+ s.email = %q{dbalatero@gmail.com}
15
+ s.extensions = ["ext/typhoeus/extconf.rb"]
16
+ s.extra_rdoc_files = [
17
+ "LICENSE",
18
+ "README.textile"
19
+ ]
20
+ s.files = [
21
+ ".gitignore",
22
+ "CHANGELOG.markdown",
23
+ "Gemfile",
24
+ "Gemfile.lock",
25
+ "LICENSE",
26
+ "README.textile",
27
+ "Rakefile",
28
+ "VERSION",
29
+ "benchmarks/profile.rb",
30
+ "benchmarks/vs_nethttp.rb",
31
+ "examples/file.rb",
32
+ "examples/times.rb",
33
+ "examples/twitter.rb",
34
+ "ext/typhoeus/.gitignore",
35
+ "ext/typhoeus/extconf.rb",
36
+ "ext/typhoeus/native.c",
37
+ "ext/typhoeus/native.h",
38
+ "ext/typhoeus/typhoeus_easy.c",
39
+ "ext/typhoeus/typhoeus_easy.h",
40
+ "ext/typhoeus/typhoeus_form.c",
41
+ "ext/typhoeus/typhoeus_form.h",
42
+ "ext/typhoeus/typhoeus_multi.c",
43
+ "ext/typhoeus/typhoeus_multi.h",
44
+ "lib/typhoeus.rb",
45
+ "lib/typhoeus/.gitignore",
46
+ "lib/typhoeus/easy.rb",
47
+ "lib/typhoeus/filter.rb",
48
+ "lib/typhoeus/form.rb",
49
+ "lib/typhoeus/hydra.rb",
50
+ "lib/typhoeus/hydra/callbacks.rb",
51
+ "lib/typhoeus/hydra/connect_options.rb",
52
+ "lib/typhoeus/hydra/stubbing.rb",
53
+ "lib/typhoeus/hydra_mock.rb",
54
+ "lib/typhoeus/multi.rb",
55
+ "lib/typhoeus/normalized_header_hash.rb",
56
+ "lib/typhoeus/remote.rb",
57
+ "lib/typhoeus/remote_method.rb",
58
+ "lib/typhoeus/remote_proxy_object.rb",
59
+ "lib/typhoeus/request.rb",
60
+ "lib/typhoeus/response.rb",
61
+ "lib/typhoeus/service.rb",
62
+ "lib/typhoeus/utils.rb",
63
+ "profilers/valgrind.rb",
64
+ "spec/fixtures/placeholder.gif",
65
+ "spec/fixtures/placeholder.txt",
66
+ "spec/fixtures/placeholder.ukn",
67
+ "spec/fixtures/result_set.xml",
68
+ "spec/servers/app.rb",
69
+ "spec/spec.opts",
70
+ "spec/spec_helper.rb",
71
+ "spec/typhoeus/easy_spec.rb",
72
+ "spec/typhoeus/filter_spec.rb",
73
+ "spec/typhoeus/form_spec.rb",
74
+ "spec/typhoeus/hydra_mock_spec.rb",
75
+ "spec/typhoeus/hydra_spec.rb",
76
+ "spec/typhoeus/multi_spec.rb",
77
+ "spec/typhoeus/normalized_header_hash_spec.rb",
78
+ "spec/typhoeus/remote_method_spec.rb",
79
+ "spec/typhoeus/remote_proxy_object_spec.rb",
80
+ "spec/typhoeus/remote_spec.rb",
81
+ "spec/typhoeus/request_spec.rb",
82
+ "spec/typhoeus/response_spec.rb",
83
+ "spec/typhoeus/utils_spec.rb",
84
+ "xenda-typhoeus.gemspec"
85
+ ]
86
+ s.homepage = %q{http://github.com/xenda/typhoeus}
87
+ s.rdoc_options = ["--charset=UTF-8"]
88
+ s.require_paths = ["lib"]
89
+ s.rubygems_version = %q{1.6.2}
90
+ s.summary = %q{A library for interacting with web services (and building SOAs) at blinding speed.}
91
+ s.test_files = [
92
+ "spec/spec_helper.rb",
93
+ "spec/typhoeus/hydra_spec.rb",
94
+ "spec/typhoeus/request_spec.rb",
95
+ "spec/typhoeus/remote_spec.rb",
96
+ "spec/typhoeus/remote_method_spec.rb",
97
+ "spec/typhoeus/response_spec.rb",
98
+ "spec/typhoeus/form_spec.rb",
99
+ "spec/typhoeus/filter_spec.rb",
100
+ "spec/typhoeus/multi_spec.rb",
101
+ "spec/typhoeus/easy_spec.rb",
102
+ "spec/typhoeus/utils_spec.rb",
103
+ "spec/typhoeus/normalized_header_hash_spec.rb",
104
+ "spec/typhoeus/hydra_mock_spec.rb",
105
+ "spec/typhoeus/remote_proxy_object_spec.rb",
106
+ "spec/servers/app.rb",
107
+ "examples/times.rb",
108
+ "examples/file.rb",
109
+ "examples/twitter.rb"
110
+ ]
111
+
112
+ if s.respond_to? :specification_version then
113
+ s.specification_version = 3
114
+
115
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
116
+ s.add_runtime_dependency(%q<mime-types>, [">= 0"])
117
+ s.add_development_dependency(%q<rspec>, [">= 0"])
118
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
119
+ s.add_development_dependency(%q<diff-lcs>, [">= 0"])
120
+ s.add_development_dependency(%q<sinatra>, [">= 0"])
121
+ s.add_development_dependency(%q<json>, [">= 0"])
122
+ else
123
+ s.add_dependency(%q<mime-types>, [">= 0"])
124
+ s.add_dependency(%q<rspec>, [">= 0"])
125
+ s.add_dependency(%q<jeweler>, [">= 0"])
126
+ s.add_dependency(%q<diff-lcs>, [">= 0"])
127
+ s.add_dependency(%q<sinatra>, [">= 0"])
128
+ s.add_dependency(%q<json>, [">= 0"])
129
+ end
130
+ else
131
+ s.add_dependency(%q<mime-types>, [">= 0"])
132
+ s.add_dependency(%q<rspec>, [">= 0"])
133
+ s.add_dependency(%q<jeweler>, [">= 0"])
134
+ s.add_dependency(%q<diff-lcs>, [">= 0"])
135
+ s.add_dependency(%q<sinatra>, [">= 0"])
136
+ s.add_dependency(%q<json>, [">= 0"])
137
+ end
138
+ end
139
+
metadata ADDED
@@ -0,0 +1,203 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: xenda-typhoeus
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.2.4
6
+ platform: ruby
7
+ authors:
8
+ - Paul Dix
9
+ - David Balatero
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+
14
+ date: 2011-05-13 00:00:00 -05:00
15
+ default_executable:
16
+ dependencies:
17
+ - !ruby/object:Gem::Dependency
18
+ name: mime-types
19
+ prerelease: false
20
+ requirement: &id001 !ruby/object:Gem::Requirement
21
+ none: false
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: "0"
26
+ type: :runtime
27
+ version_requirements: *id001
28
+ - !ruby/object:Gem::Dependency
29
+ name: rspec
30
+ prerelease: false
31
+ requirement: &id002 !ruby/object:Gem::Requirement
32
+ none: false
33
+ requirements:
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: "0"
37
+ type: :development
38
+ version_requirements: *id002
39
+ - !ruby/object:Gem::Dependency
40
+ name: jeweler
41
+ prerelease: false
42
+ requirement: &id003 !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: "0"
48
+ type: :development
49
+ version_requirements: *id003
50
+ - !ruby/object:Gem::Dependency
51
+ name: diff-lcs
52
+ prerelease: false
53
+ requirement: &id004 !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: "0"
59
+ type: :development
60
+ version_requirements: *id004
61
+ - !ruby/object:Gem::Dependency
62
+ name: sinatra
63
+ prerelease: false
64
+ requirement: &id005 !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: "0"
70
+ type: :development
71
+ version_requirements: *id005
72
+ - !ruby/object:Gem::Dependency
73
+ name: json
74
+ prerelease: false
75
+ requirement: &id006 !ruby/object:Gem::Requirement
76
+ none: false
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: "0"
81
+ type: :development
82
+ version_requirements: *id006
83
+ 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.
84
+ email: dbalatero@gmail.com
85
+ executables: []
86
+
87
+ extensions:
88
+ - ext/typhoeus/extconf.rb
89
+ extra_rdoc_files:
90
+ - LICENSE
91
+ - README.textile
92
+ files:
93
+ - .gitignore
94
+ - CHANGELOG.markdown
95
+ - Gemfile
96
+ - Gemfile.lock
97
+ - LICENSE
98
+ - README.textile
99
+ - Rakefile
100
+ - VERSION
101
+ - benchmarks/profile.rb
102
+ - benchmarks/vs_nethttp.rb
103
+ - examples/file.rb
104
+ - examples/times.rb
105
+ - examples/twitter.rb
106
+ - ext/typhoeus/.gitignore
107
+ - ext/typhoeus/extconf.rb
108
+ - ext/typhoeus/native.c
109
+ - ext/typhoeus/native.h
110
+ - ext/typhoeus/typhoeus_easy.c
111
+ - ext/typhoeus/typhoeus_easy.h
112
+ - ext/typhoeus/typhoeus_form.c
113
+ - ext/typhoeus/typhoeus_form.h
114
+ - ext/typhoeus/typhoeus_multi.c
115
+ - ext/typhoeus/typhoeus_multi.h
116
+ - lib/typhoeus.rb
117
+ - lib/typhoeus/.gitignore
118
+ - lib/typhoeus/easy.rb
119
+ - lib/typhoeus/filter.rb
120
+ - lib/typhoeus/form.rb
121
+ - lib/typhoeus/hydra.rb
122
+ - lib/typhoeus/hydra/callbacks.rb
123
+ - lib/typhoeus/hydra/connect_options.rb
124
+ - lib/typhoeus/hydra/stubbing.rb
125
+ - lib/typhoeus/hydra_mock.rb
126
+ - lib/typhoeus/multi.rb
127
+ - lib/typhoeus/normalized_header_hash.rb
128
+ - lib/typhoeus/remote.rb
129
+ - lib/typhoeus/remote_method.rb
130
+ - lib/typhoeus/remote_proxy_object.rb
131
+ - lib/typhoeus/request.rb
132
+ - lib/typhoeus/response.rb
133
+ - lib/typhoeus/service.rb
134
+ - lib/typhoeus/utils.rb
135
+ - profilers/valgrind.rb
136
+ - spec/fixtures/placeholder.gif
137
+ - spec/fixtures/placeholder.txt
138
+ - spec/fixtures/placeholder.ukn
139
+ - spec/fixtures/result_set.xml
140
+ - spec/servers/app.rb
141
+ - spec/spec.opts
142
+ - spec/spec_helper.rb
143
+ - spec/typhoeus/easy_spec.rb
144
+ - spec/typhoeus/filter_spec.rb
145
+ - spec/typhoeus/form_spec.rb
146
+ - spec/typhoeus/hydra_mock_spec.rb
147
+ - spec/typhoeus/hydra_spec.rb
148
+ - spec/typhoeus/multi_spec.rb
149
+ - spec/typhoeus/normalized_header_hash_spec.rb
150
+ - spec/typhoeus/remote_method_spec.rb
151
+ - spec/typhoeus/remote_proxy_object_spec.rb
152
+ - spec/typhoeus/remote_spec.rb
153
+ - spec/typhoeus/request_spec.rb
154
+ - spec/typhoeus/response_spec.rb
155
+ - spec/typhoeus/utils_spec.rb
156
+ - xenda-typhoeus.gemspec
157
+ has_rdoc: true
158
+ homepage: http://github.com/xenda/typhoeus
159
+ licenses: []
160
+
161
+ post_install_message:
162
+ rdoc_options:
163
+ - --charset=UTF-8
164
+ require_paths:
165
+ - lib
166
+ required_ruby_version: !ruby/object:Gem::Requirement
167
+ none: false
168
+ requirements:
169
+ - - ">="
170
+ - !ruby/object:Gem::Version
171
+ version: "0"
172
+ required_rubygems_version: !ruby/object:Gem::Requirement
173
+ none: false
174
+ requirements:
175
+ - - ">="
176
+ - !ruby/object:Gem::Version
177
+ version: "0"
178
+ requirements: []
179
+
180
+ rubyforge_project:
181
+ rubygems_version: 1.5.0
182
+ signing_key:
183
+ specification_version: 3
184
+ summary: A library for interacting with web services (and building SOAs) at blinding speed.
185
+ test_files:
186
+ - spec/spec_helper.rb
187
+ - spec/typhoeus/hydra_spec.rb
188
+ - spec/typhoeus/request_spec.rb
189
+ - spec/typhoeus/remote_spec.rb
190
+ - spec/typhoeus/remote_method_spec.rb
191
+ - spec/typhoeus/response_spec.rb
192
+ - spec/typhoeus/form_spec.rb
193
+ - spec/typhoeus/filter_spec.rb
194
+ - spec/typhoeus/multi_spec.rb
195
+ - spec/typhoeus/easy_spec.rb
196
+ - spec/typhoeus/utils_spec.rb
197
+ - spec/typhoeus/normalized_header_hash_spec.rb
198
+ - spec/typhoeus/hydra_mock_spec.rb
199
+ - spec/typhoeus/remote_proxy_object_spec.rb
200
+ - spec/servers/app.rb
201
+ - examples/times.rb
202
+ - examples/file.rb
203
+ - examples/twitter.rb