httpadapter 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +3 -0
- data/LICENSE +202 -0
- data/README +47 -0
- data/Rakefile +59 -0
- data/lib/httpadapter/adapters/net_http.rb +192 -0
- data/lib/httpadapter/adapters/rack.rb +117 -0
- data/lib/httpadapter/adapters/typhoeus.rb +92 -0
- data/lib/httpadapter/version.rb +26 -0
- data/lib/httpadapter.rb +232 -0
- data/spec/httpadapter/adapters/net_http_request_spec.rb +415 -0
- data/spec/httpadapter/adapters/net_http_response_spec.rb +170 -0
- data/spec/httpadapter/adapters/rack_request_spec.rb +228 -0
- data/spec/httpadapter/adapters/rack_response_spec.rb +158 -0
- data/spec/httpadapter/adapters/typhoeus_request_spec.rb +203 -0
- data/spec/httpadapter/adapters/typhoeus_response_spec.rb +146 -0
- data/spec/httpadapter_spec.rb +224 -0
- data/spec/spec.opts +2 -0
- data/spec/spec_helper.rb +7 -0
- data/tasks/clobber.rake +2 -0
- data/tasks/gem.rake +73 -0
- data/tasks/git.rake +40 -0
- data/tasks/metrics.rake +22 -0
- data/tasks/rdoc.rake +26 -0
- data/tasks/rubyforge.rake +103 -0
- data/tasks/spec.rake +69 -0
- data/tasks/yard.rake +26 -0
- data/website/index.html +95 -0
- metadata +207 -0
data/tasks/spec.rake
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
require 'spec/rake/verify_rcov'
|
2
|
+
|
3
|
+
namespace :spec do
|
4
|
+
Spec::Rake::SpecTask.new(:rcov) do |t|
|
5
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
6
|
+
t.spec_opts = ['--color', '--format', 'specdoc']
|
7
|
+
if RCOV_ENABLED
|
8
|
+
if `which rcov`.strip == ""
|
9
|
+
STDERR.puts "Please install rcov:"
|
10
|
+
STDERR.puts "sudo gem install relevance-rcov"
|
11
|
+
exit(1)
|
12
|
+
end
|
13
|
+
t.rcov = true
|
14
|
+
else
|
15
|
+
t.rcov = false
|
16
|
+
end
|
17
|
+
t.rcov_opts = [
|
18
|
+
'--exclude', 'spec',
|
19
|
+
'--exclude', '1\\.8\\/gems',
|
20
|
+
'--exclude', '1\\.9\\/gems',
|
21
|
+
'--exclude', 'addressable\\/idna\\.rb', # unicode tables too big
|
22
|
+
]
|
23
|
+
end
|
24
|
+
|
25
|
+
Spec::Rake::SpecTask.new(:normal) do |t|
|
26
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
27
|
+
t.spec_opts = ['--color', '--format', 'specdoc']
|
28
|
+
t.rcov = false
|
29
|
+
end
|
30
|
+
|
31
|
+
if RCOV_ENABLED
|
32
|
+
RCov::VerifyTask.new(:verify) do |t|
|
33
|
+
t.threshold = 100.0
|
34
|
+
t.index_html = 'coverage/index.html'
|
35
|
+
end
|
36
|
+
|
37
|
+
task :verify => :rcov
|
38
|
+
end
|
39
|
+
|
40
|
+
desc "Generate HTML Specdocs for all specs"
|
41
|
+
Spec::Rake::SpecTask.new(:specdoc) do |t|
|
42
|
+
specdoc_path = File.expand_path(
|
43
|
+
File.join(File.dirname(__FILE__), '../specdoc/'))
|
44
|
+
Dir.mkdir(specdoc_path) if !File.exist?(specdoc_path)
|
45
|
+
|
46
|
+
output_file = File.join(specdoc_path, 'index.html')
|
47
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
48
|
+
t.spec_opts = ["--format", "\"html:#{output_file}\"", "--diff"]
|
49
|
+
t.fail_on_error = false
|
50
|
+
end
|
51
|
+
|
52
|
+
namespace :rcov do
|
53
|
+
desc "Browse the code coverage report."
|
54
|
+
task :browse => "spec:rcov" do
|
55
|
+
require "launchy"
|
56
|
+
Launchy::Browser.run("coverage/index.html")
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
if RCOV_ENABLED
|
62
|
+
desc "Alias to spec:verify"
|
63
|
+
task "spec" => "spec:verify"
|
64
|
+
else
|
65
|
+
desc "Alias to spec:normal"
|
66
|
+
task "spec" => "spec:normal"
|
67
|
+
end
|
68
|
+
|
69
|
+
task "clobber" => ["spec:clobber_rcov"]
|
data/tasks/yard.rake
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'rake'
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'yard'
|
5
|
+
require 'yard/rake/yardoc_task'
|
6
|
+
|
7
|
+
namespace :doc do
|
8
|
+
desc 'Generate Yardoc documentation'
|
9
|
+
YARD::Rake::YardocTask.new do |yardoc|
|
10
|
+
yardoc.name = 'yard'
|
11
|
+
yardoc.options = ['--verbose']
|
12
|
+
yardoc.files = [
|
13
|
+
'lib/**/*.rb', 'ext/**/*.c', 'README', 'CHANGELOG', 'LICENSE'
|
14
|
+
]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
task 'clobber' => ['doc:clobber_yard']
|
19
|
+
|
20
|
+
desc 'Alias to doc:yard'
|
21
|
+
task 'doc' => 'doc:yard'
|
22
|
+
rescue LoadError
|
23
|
+
# If yard isn't available, it's not the end of the world
|
24
|
+
desc 'Alias to doc:rdoc'
|
25
|
+
task 'doc' => 'doc:rdoc'
|
26
|
+
end
|
data/website/index.html
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8"/>
|
5
|
+
<title>HTTPAdapter</title>
|
6
|
+
<style type="text/css">
|
7
|
+
* {
|
8
|
+
font-size: 100%;
|
9
|
+
margin: 0;
|
10
|
+
padding: 0;
|
11
|
+
}
|
12
|
+
|
13
|
+
body {
|
14
|
+
font-family: "Lucida Grande", Verdana, sans-serif;
|
15
|
+
margin: 1em;
|
16
|
+
}
|
17
|
+
|
18
|
+
a {
|
19
|
+
color: #880000;
|
20
|
+
}
|
21
|
+
|
22
|
+
a:visited {
|
23
|
+
color: #333333;
|
24
|
+
}
|
25
|
+
|
26
|
+
h1 {
|
27
|
+
font-size: 2em;
|
28
|
+
margin: 0 0 0.8em 0;
|
29
|
+
text-align: center;
|
30
|
+
}
|
31
|
+
|
32
|
+
h2 {
|
33
|
+
font-size: 1em;
|
34
|
+
margin: 0.8em 0;
|
35
|
+
}
|
36
|
+
|
37
|
+
p {
|
38
|
+
margin: 0.8em 0;
|
39
|
+
}
|
40
|
+
|
41
|
+
ul {
|
42
|
+
font-size: 0.9em;
|
43
|
+
margin: 0 0 0 1.5em;
|
44
|
+
}
|
45
|
+
|
46
|
+
div {
|
47
|
+
width: 50%;
|
48
|
+
margin: 0 auto;
|
49
|
+
padding: 0.8em;
|
50
|
+
background-color: #AA5852;
|
51
|
+
border: 2px solid #C2645D;
|
52
|
+
}
|
53
|
+
|
54
|
+
@media print {
|
55
|
+
body {
|
56
|
+
font-size: 0.9em;
|
57
|
+
}
|
58
|
+
|
59
|
+
a {
|
60
|
+
text-decoration: none;
|
61
|
+
color: #000;
|
62
|
+
}
|
63
|
+
}
|
64
|
+
</style>
|
65
|
+
</head>
|
66
|
+
<body>
|
67
|
+
<h1>HTTPAdapter</h1>
|
68
|
+
<div>
|
69
|
+
<p>
|
70
|
+
A library for translating HTTP request and response objects for various clients into a common representation.
|
71
|
+
</p>
|
72
|
+
<ul>
|
73
|
+
<li>
|
74
|
+
<a href="http://rubyforge.org/projects/httpadapter/">
|
75
|
+
Project Page
|
76
|
+
</a>
|
77
|
+
</li>
|
78
|
+
<li>
|
79
|
+
<a href="http://github.com/sporkmonger/httpadapter/tree/">
|
80
|
+
GitHub Page
|
81
|
+
</a>
|
82
|
+
</li>
|
83
|
+
<li><a href="/api/">API</a></li>
|
84
|
+
<li><a href="/specdoc/">Specifications</a></li>
|
85
|
+
<li><a href="/coverage/">Code Coverage</a></li>
|
86
|
+
</ul>
|
87
|
+
<p>
|
88
|
+
You know what to do:
|
89
|
+
</p>
|
90
|
+
<p>
|
91
|
+
<code>sudo gem install httpadapter</code>
|
92
|
+
</p>
|
93
|
+
</div>
|
94
|
+
</body>
|
95
|
+
</html>
|
metadata
ADDED
@@ -0,0 +1,207 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: httpadapter
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 25
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Bob Aman
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-08-30 00:00:00 -07:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: addressable
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 7
|
30
|
+
segments:
|
31
|
+
- 2
|
32
|
+
- 2
|
33
|
+
- 0
|
34
|
+
version: 2.2.0
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: rake
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 57
|
46
|
+
segments:
|
47
|
+
- 0
|
48
|
+
- 8
|
49
|
+
- 3
|
50
|
+
version: 0.8.3
|
51
|
+
type: :development
|
52
|
+
version_requirements: *id002
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: rspec
|
55
|
+
prerelease: false
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 5
|
62
|
+
segments:
|
63
|
+
- 1
|
64
|
+
- 1
|
65
|
+
- 11
|
66
|
+
version: 1.1.11
|
67
|
+
type: :development
|
68
|
+
version_requirements: *id003
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: launchy
|
71
|
+
prerelease: false
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
hash: 23
|
78
|
+
segments:
|
79
|
+
- 0
|
80
|
+
- 3
|
81
|
+
- 2
|
82
|
+
version: 0.3.2
|
83
|
+
type: :development
|
84
|
+
version_requirements: *id004
|
85
|
+
- !ruby/object:Gem::Dependency
|
86
|
+
name: diff-lcs
|
87
|
+
prerelease: false
|
88
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
hash: 23
|
94
|
+
segments:
|
95
|
+
- 1
|
96
|
+
- 1
|
97
|
+
- 2
|
98
|
+
version: 1.1.2
|
99
|
+
type: :development
|
100
|
+
version_requirements: *id005
|
101
|
+
- !ruby/object:Gem::Dependency
|
102
|
+
name: typhoeus
|
103
|
+
prerelease: false
|
104
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ~>
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
hash: 37
|
110
|
+
segments:
|
111
|
+
- 0
|
112
|
+
- 1
|
113
|
+
- 31
|
114
|
+
version: 0.1.31
|
115
|
+
type: :development
|
116
|
+
version_requirements: *id006
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: rack
|
119
|
+
prerelease: false
|
120
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
hash: 29
|
126
|
+
segments:
|
127
|
+
- 1
|
128
|
+
- 2
|
129
|
+
- 1
|
130
|
+
version: 1.2.1
|
131
|
+
type: :development
|
132
|
+
version_requirements: *id007
|
133
|
+
description: |
|
134
|
+
A library for translating HTTP request and response objects for various clients into a common representation.
|
135
|
+
|
136
|
+
email: bob@sporkmonger.com
|
137
|
+
executables: []
|
138
|
+
|
139
|
+
extensions: []
|
140
|
+
|
141
|
+
extra_rdoc_files:
|
142
|
+
- README
|
143
|
+
files:
|
144
|
+
- lib/httpadapter/adapters/net_http.rb
|
145
|
+
- lib/httpadapter/adapters/rack.rb
|
146
|
+
- lib/httpadapter/adapters/typhoeus.rb
|
147
|
+
- lib/httpadapter/version.rb
|
148
|
+
- lib/httpadapter.rb
|
149
|
+
- spec/httpadapter/adapters/net_http_request_spec.rb
|
150
|
+
- spec/httpadapter/adapters/net_http_response_spec.rb
|
151
|
+
- spec/httpadapter/adapters/rack_request_spec.rb
|
152
|
+
- spec/httpadapter/adapters/rack_response_spec.rb
|
153
|
+
- spec/httpadapter/adapters/typhoeus_request_spec.rb
|
154
|
+
- spec/httpadapter/adapters/typhoeus_response_spec.rb
|
155
|
+
- spec/httpadapter_spec.rb
|
156
|
+
- spec/spec.opts
|
157
|
+
- spec/spec_helper.rb
|
158
|
+
- tasks/clobber.rake
|
159
|
+
- tasks/gem.rake
|
160
|
+
- tasks/git.rake
|
161
|
+
- tasks/metrics.rake
|
162
|
+
- tasks/rdoc.rake
|
163
|
+
- tasks/rubyforge.rake
|
164
|
+
- tasks/spec.rake
|
165
|
+
- tasks/yard.rake
|
166
|
+
- website/index.html
|
167
|
+
- CHANGELOG
|
168
|
+
- LICENSE
|
169
|
+
- Rakefile
|
170
|
+
- README
|
171
|
+
has_rdoc: true
|
172
|
+
homepage: http://httpadapter.rubyforge.org/
|
173
|
+
licenses: []
|
174
|
+
|
175
|
+
post_install_message:
|
176
|
+
rdoc_options:
|
177
|
+
- --main
|
178
|
+
- README
|
179
|
+
require_paths:
|
180
|
+
- lib
|
181
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
182
|
+
none: false
|
183
|
+
requirements:
|
184
|
+
- - ">="
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
hash: 3
|
187
|
+
segments:
|
188
|
+
- 0
|
189
|
+
version: "0"
|
190
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
191
|
+
none: false
|
192
|
+
requirements:
|
193
|
+
- - ">="
|
194
|
+
- !ruby/object:Gem::Version
|
195
|
+
hash: 3
|
196
|
+
segments:
|
197
|
+
- 0
|
198
|
+
version: "0"
|
199
|
+
requirements: []
|
200
|
+
|
201
|
+
rubyforge_project: httpadapter
|
202
|
+
rubygems_version: 1.3.7
|
203
|
+
signing_key:
|
204
|
+
specification_version: 3
|
205
|
+
summary: Package Summary
|
206
|
+
test_files: []
|
207
|
+
|