aitch 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -0
- data/aitch.gemspec +2 -2
- data/lib/aitch/request.rb +1 -0
- data/lib/aitch/version.rb +1 -1
- data/spec/aitch/aitch_spec.rb +3 -3
- data/spec/aitch/request_spec.rb +2 -2
- data/spec/aitch/response_spec.rb +2 -2
- metadata +49 -29
- checksums.yaml +0 -7
data/.travis.yml
CHANGED
data/aitch.gemspec
CHANGED
@@ -18,12 +18,12 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "nokogiri"
|
21
|
+
spec.add_dependency "nokogiri", ">= 1.6.0"
|
22
22
|
spec.add_dependency "activesupport"
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler"
|
25
25
|
spec.add_development_dependency "rake"
|
26
|
-
spec.add_development_dependency "rspec"
|
26
|
+
spec.add_development_dependency "rspec", "~> 2.14.0.rc1"
|
27
27
|
spec.add_development_dependency "pry-meta"
|
28
28
|
spec.add_development_dependency "test_notifier"
|
29
29
|
spec.add_development_dependency "fakeweb"
|
data/lib/aitch/request.rb
CHANGED
data/lib/aitch/version.rb
CHANGED
data/spec/aitch/aitch_spec.rb
CHANGED
@@ -25,7 +25,7 @@ describe Aitch do
|
|
25
25
|
end
|
26
26
|
|
27
27
|
describe "#execute" do
|
28
|
-
let(:request) {
|
28
|
+
let(:request) { double.as_null_object }
|
29
29
|
|
30
30
|
it "delegates to Request" do
|
31
31
|
expected = {
|
@@ -55,14 +55,14 @@ describe Aitch do
|
|
55
55
|
|
56
56
|
describe "#execute!" do
|
57
57
|
it "returns response when successful" do
|
58
|
-
response =
|
58
|
+
response = double(error?: false)
|
59
59
|
Aitch::Request.any_instance.stub perform: response
|
60
60
|
|
61
61
|
expect(Aitch.get!("URL")).to eql(response)
|
62
62
|
end
|
63
63
|
|
64
64
|
it "raises when has errors" do
|
65
|
-
response =
|
65
|
+
response = double(error?: true, error: "ERROR")
|
66
66
|
Aitch::Request.any_instance.stub perform: response
|
67
67
|
|
68
68
|
expect {
|
data/spec/aitch/request_spec.rb
CHANGED
@@ -60,13 +60,13 @@ describe Aitch::Request do
|
|
60
60
|
end
|
61
61
|
|
62
62
|
it "sets request body from to_h protocol" do
|
63
|
-
data =
|
63
|
+
data = double(to_h: {a: 1})
|
64
64
|
request = build_request(request_method: "post", data: data).request
|
65
65
|
expect(request.body).to eql("a=1")
|
66
66
|
end
|
67
67
|
|
68
68
|
it "sets request body from to_s protocol" do
|
69
|
-
data =
|
69
|
+
data = double(to_s: "some body")
|
70
70
|
request = build_request(request_method: "post", data: data).request
|
71
71
|
|
72
72
|
expect(request.body).to eql("some body")
|
data/spec/aitch/response_spec.rb
CHANGED
@@ -182,8 +182,8 @@ describe Aitch::Response do
|
|
182
182
|
name = Aitch::Utils.underscore(exception.name.split("::").last).gsub("_error", "")
|
183
183
|
|
184
184
|
it "detects response as #{name}" do
|
185
|
-
config =
|
186
|
-
http_response =
|
185
|
+
config = double
|
186
|
+
http_response = double(code: code)
|
187
187
|
response = Aitch::Response.new(config, http_response)
|
188
188
|
expect(response.public_send("#{name}?")).to be_true
|
189
189
|
end
|
metadata
CHANGED
@@ -1,139 +1,158 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aitch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Nando Vieira
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2013-06-
|
12
|
+
date: 2013-06-26 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: nokogiri
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
|
-
- - '>='
|
19
|
+
- - ! '>='
|
18
20
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
21
|
+
version: 1.6.0
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
|
-
- - '>='
|
27
|
+
- - ! '>='
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
29
|
+
version: 1.6.0
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: activesupport
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
|
-
- - '>='
|
35
|
+
- - ! '>='
|
32
36
|
- !ruby/object:Gem::Version
|
33
37
|
version: '0'
|
34
38
|
type: :runtime
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
|
-
- - '>='
|
43
|
+
- - ! '>='
|
39
44
|
- !ruby/object:Gem::Version
|
40
45
|
version: '0'
|
41
46
|
- !ruby/object:Gem::Dependency
|
42
47
|
name: bundler
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
44
50
|
requirements:
|
45
|
-
- - '>='
|
51
|
+
- - ! '>='
|
46
52
|
- !ruby/object:Gem::Version
|
47
53
|
version: '0'
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
51
58
|
requirements:
|
52
|
-
- - '>='
|
59
|
+
- - ! '>='
|
53
60
|
- !ruby/object:Gem::Version
|
54
61
|
version: '0'
|
55
62
|
- !ruby/object:Gem::Dependency
|
56
63
|
name: rake
|
57
64
|
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
58
66
|
requirements:
|
59
|
-
- - '>='
|
67
|
+
- - ! '>='
|
60
68
|
- !ruby/object:Gem::Version
|
61
69
|
version: '0'
|
62
70
|
type: :development
|
63
71
|
prerelease: false
|
64
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
65
74
|
requirements:
|
66
|
-
- - '>='
|
75
|
+
- - ! '>='
|
67
76
|
- !ruby/object:Gem::Version
|
68
77
|
version: '0'
|
69
78
|
- !ruby/object:Gem::Dependency
|
70
79
|
name: rspec
|
71
80
|
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
72
82
|
requirements:
|
73
|
-
- -
|
83
|
+
- - ~>
|
74
84
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
85
|
+
version: 2.14.0.rc1
|
76
86
|
type: :development
|
77
87
|
prerelease: false
|
78
88
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
79
90
|
requirements:
|
80
|
-
- -
|
91
|
+
- - ~>
|
81
92
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
93
|
+
version: 2.14.0.rc1
|
83
94
|
- !ruby/object:Gem::Dependency
|
84
95
|
name: pry-meta
|
85
96
|
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
86
98
|
requirements:
|
87
|
-
- - '>='
|
99
|
+
- - ! '>='
|
88
100
|
- !ruby/object:Gem::Version
|
89
101
|
version: '0'
|
90
102
|
type: :development
|
91
103
|
prerelease: false
|
92
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
93
106
|
requirements:
|
94
|
-
- - '>='
|
107
|
+
- - ! '>='
|
95
108
|
- !ruby/object:Gem::Version
|
96
109
|
version: '0'
|
97
110
|
- !ruby/object:Gem::Dependency
|
98
111
|
name: test_notifier
|
99
112
|
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
100
114
|
requirements:
|
101
|
-
- - '>='
|
115
|
+
- - ! '>='
|
102
116
|
- !ruby/object:Gem::Version
|
103
117
|
version: '0'
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
107
122
|
requirements:
|
108
|
-
- - '>='
|
123
|
+
- - ! '>='
|
109
124
|
- !ruby/object:Gem::Version
|
110
125
|
version: '0'
|
111
126
|
- !ruby/object:Gem::Dependency
|
112
127
|
name: fakeweb
|
113
128
|
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
114
130
|
requirements:
|
115
|
-
- - '>='
|
131
|
+
- - ! '>='
|
116
132
|
- !ruby/object:Gem::Version
|
117
133
|
version: '0'
|
118
134
|
type: :development
|
119
135
|
prerelease: false
|
120
136
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
121
138
|
requirements:
|
122
|
-
- - '>='
|
139
|
+
- - ! '>='
|
123
140
|
- !ruby/object:Gem::Version
|
124
141
|
version: '0'
|
125
142
|
- !ruby/object:Gem::Dependency
|
126
143
|
name: nokogiri
|
127
144
|
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
128
146
|
requirements:
|
129
|
-
- - '>='
|
147
|
+
- - ! '>='
|
130
148
|
- !ruby/object:Gem::Version
|
131
149
|
version: '0'
|
132
150
|
type: :development
|
133
151
|
prerelease: false
|
134
152
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
135
154
|
requirements:
|
136
|
-
- - '>='
|
155
|
+
- - ! '>='
|
137
156
|
- !ruby/object:Gem::Version
|
138
157
|
version: '0'
|
139
158
|
description: A simple HTTP client
|
@@ -180,26 +199,27 @@ files:
|
|
180
199
|
homepage: http://rubygems.org/gems/aitch
|
181
200
|
licenses:
|
182
201
|
- MIT
|
183
|
-
metadata: {}
|
184
202
|
post_install_message:
|
185
203
|
rdoc_options: []
|
186
204
|
require_paths:
|
187
205
|
- lib
|
188
206
|
required_ruby_version: !ruby/object:Gem::Requirement
|
207
|
+
none: false
|
189
208
|
requirements:
|
190
|
-
- - '>='
|
209
|
+
- - ! '>='
|
191
210
|
- !ruby/object:Gem::Version
|
192
211
|
version: '0'
|
193
212
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
213
|
+
none: false
|
194
214
|
requirements:
|
195
|
-
- - '>='
|
215
|
+
- - ! '>='
|
196
216
|
- !ruby/object:Gem::Version
|
197
217
|
version: '0'
|
198
218
|
requirements: []
|
199
219
|
rubyforge_project:
|
200
|
-
rubygems_version:
|
220
|
+
rubygems_version: 1.8.23
|
201
221
|
signing_key:
|
202
|
-
specification_version:
|
222
|
+
specification_version: 3
|
203
223
|
summary: A simple HTTP client
|
204
224
|
test_files:
|
205
225
|
- spec/aitch/aitch_spec.rb
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 3dafc61f37b289947518c8879951025874155bf7
|
4
|
-
data.tar.gz: f684b8320ddd805a08e623f896bf53e146d199b0
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 620b2fb8f76ec9982ffd0609f3add953466404d93ed4a385f60cfcfa7a9121ec0d1ff4873a58740d3a20c30247ea365dc94bc6243524e566f4147259581f3a16
|
7
|
-
data.tar.gz: c645b75d8bb7be5273313883a18b2ab8068a283a925c0b8b47f8c05de917e925beee19f5c3154cf0298a253351bde5fe9887a1e87417917e57965d8ab9cf68c5
|