grape 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grape might be problematic. Click here for more details.
- data/CHANGELOG.md +15 -0
- data/Gemfile +1 -0
- data/README.md +58 -11
- data/grape.gemspec +1 -1
- data/lib/grape.rb +3 -1
- data/lib/grape/api.rb +4 -4
- data/lib/grape/endpoint.rb +20 -16
- data/lib/grape/formatter/json.rb +0 -1
- data/lib/grape/locale/en.yml +1 -1
- data/lib/grape/middleware/formatter.rb +27 -17
- data/lib/grape/namespace.rb +24 -0
- data/lib/grape/version.rb +1 -1
- data/spec/grape/api_spec.rb +68 -7
- data/spec/grape/endpoint_spec.rb +40 -12
- data/spec/grape/entity_spec.rb +22 -6
- data/spec/grape/validations/presence_spec.rb +5 -5
- data/spec/shared/versioning_examples.rb +6 -2
- metadata +155 -208
data/spec/grape/endpoint_spec.rb
CHANGED
@@ -168,8 +168,6 @@ describe Grape::Endpoint do
|
|
168
168
|
requires :first
|
169
169
|
optional :second
|
170
170
|
end
|
171
|
-
|
172
|
-
|
173
171
|
end
|
174
172
|
|
175
173
|
it 'has as many keys as there are declared params' do
|
@@ -246,33 +244,63 @@ describe Grape::Endpoint do
|
|
246
244
|
params[:person_email]
|
247
245
|
end
|
248
246
|
|
249
|
-
get '/
|
250
|
-
last_response.body.should == '
|
247
|
+
get '/someone@example.com'
|
248
|
+
last_response.body.should == 'someone@example.com'
|
251
249
|
|
252
|
-
get '
|
253
|
-
last_response.body.should == '
|
250
|
+
get 'someone@example.com.pl'
|
251
|
+
last_response.body.should == 'someone@example.com.pl'
|
254
252
|
end
|
255
253
|
|
256
254
|
it 'parses many params with provided regexps' do
|
257
255
|
subject.get('/:person_email/test/:number',
|
258
256
|
:requirements => {
|
259
|
-
:person_email => /
|
257
|
+
:person_email => /someone@(.*).com/,
|
260
258
|
:number => /[0-9]/ }) do
|
261
259
|
params[:person_email] << params[:number]
|
262
260
|
end
|
263
261
|
|
264
|
-
get '/
|
265
|
-
last_response.body.should == '
|
262
|
+
get '/someone@example.com/test/1'
|
263
|
+
last_response.body.should == 'someone@example.com1'
|
266
264
|
|
267
|
-
get '/
|
265
|
+
get '/someone@testing.wrong/test/1'
|
268
266
|
last_response.status.should == 404
|
269
267
|
|
270
|
-
get '
|
268
|
+
get 'someone@test.com/test/wrong_number'
|
271
269
|
last_response.status.should == 404
|
272
270
|
|
273
|
-
get '
|
271
|
+
get 'someone@test.com/wrong_middle/1'
|
274
272
|
last_response.status.should == 404
|
275
273
|
end
|
274
|
+
|
275
|
+
context 'namespace requirements' do
|
276
|
+
before :each do
|
277
|
+
subject.namespace :outer, :requirements => { :person_email => /abc@(.*).com/ } do
|
278
|
+
get('/:person_email') do
|
279
|
+
params[:person_email]
|
280
|
+
end
|
281
|
+
|
282
|
+
namespace :inner, :requirements => {:number => /[0-9]/, :person_email => /someone@(.*).com/ }do
|
283
|
+
get '/:person_email/test/:number' do
|
284
|
+
params[:person_email] << params[:number]
|
285
|
+
end
|
286
|
+
end
|
287
|
+
end
|
288
|
+
end
|
289
|
+
it "parse email param with provided requirements for params" do
|
290
|
+
get '/outer/abc@example.com'
|
291
|
+
last_response.body.should == 'abc@example.com'
|
292
|
+
end
|
293
|
+
|
294
|
+
it "should override outer namespace's requirements" do
|
295
|
+
get '/outer/inner/someone@testing.wrong/test/1'
|
296
|
+
last_response.status.should == 404
|
297
|
+
|
298
|
+
get '/outer/inner/someone@testing.com/test/1'
|
299
|
+
last_response.status.should == 200
|
300
|
+
last_response.body.should == 'someone@testing.com1'
|
301
|
+
end
|
302
|
+
|
303
|
+
end
|
276
304
|
end
|
277
305
|
|
278
306
|
context 'from body parameters' do
|
data/spec/grape/entity_spec.rb
CHANGED
@@ -40,13 +40,24 @@ describe Grape::Entity do
|
|
40
40
|
entity.stub!(:represent).and_return("Hiya")
|
41
41
|
|
42
42
|
class TestObject; end
|
43
|
+
class FakeCollection
|
44
|
+
def first; TestObject.new; end
|
45
|
+
end
|
43
46
|
|
44
47
|
subject.represent TestObject, :with => entity
|
45
48
|
subject.get '/example' do
|
46
49
|
present [TestObject.new]
|
47
50
|
end
|
51
|
+
|
52
|
+
subject.get '/example2' do
|
53
|
+
present FakeCollection.new
|
54
|
+
end
|
55
|
+
|
48
56
|
get '/example'
|
49
57
|
last_response.body.should == "Hiya"
|
58
|
+
|
59
|
+
get '/example2'
|
60
|
+
last_response.body.should == "Hiya"
|
50
61
|
end
|
51
62
|
|
52
63
|
it 'pulls a representation from the class ancestor if it exists' do
|
@@ -197,14 +208,18 @@ XML
|
|
197
208
|
last_response.body.should == '{"example":{"name":"johnnyiller"}}'
|
198
209
|
end
|
199
210
|
|
200
|
-
it 'presents with jsonp
|
211
|
+
it 'presents with jsonp utilising Rack::JSONP' do
|
212
|
+
require 'rack/contrib'
|
213
|
+
|
214
|
+
# Include JSONP middleware
|
215
|
+
subject.use Rack::JSONP
|
216
|
+
|
201
217
|
entity = Class.new(Grape::Entity)
|
202
218
|
entity.root "examples", "example"
|
203
219
|
entity.expose :name
|
204
220
|
|
205
|
-
|
206
|
-
subject.
|
207
|
-
subject.format :jsonp
|
221
|
+
# Rack::JSONP expects a standard JSON response
|
222
|
+
subject.format :json
|
208
223
|
|
209
224
|
subject.get '/example' do
|
210
225
|
c = Class.new do
|
@@ -216,10 +231,11 @@ XML
|
|
216
231
|
|
217
232
|
present c.new({:name => "johnnyiller"}), :with => entity
|
218
233
|
end
|
219
|
-
|
234
|
+
|
235
|
+
get '/example?callback=abcDef'
|
220
236
|
last_response.status.should == 200
|
221
237
|
last_response.headers['Content-type'].should == "application/javascript"
|
222
|
-
last_response.body.should == '{"example":{"name":"johnnyiller"}}'
|
238
|
+
last_response.body.should == 'abcDef({"example":{"name":"johnnyiller"}})'
|
223
239
|
end
|
224
240
|
|
225
241
|
end
|
@@ -17,7 +17,7 @@ describe Grape::Validations::PresenceValidator do
|
|
17
17
|
requires :id, :regexp => /^[0-9]+$/
|
18
18
|
end
|
19
19
|
post do
|
20
|
-
{:ret => params[:id]}
|
20
|
+
{ :ret => params[:id] }
|
21
21
|
end
|
22
22
|
|
23
23
|
params do
|
@@ -60,7 +60,7 @@ describe Grape::Validations::PresenceValidator do
|
|
60
60
|
it 'does not validate for any params' do
|
61
61
|
get("/bacons")
|
62
62
|
last_response.status.should == 200
|
63
|
-
last_response.body.should == "All the bacon"
|
63
|
+
last_response.body.should == "All the bacon".to_json
|
64
64
|
end
|
65
65
|
|
66
66
|
it 'validates id' do
|
@@ -94,7 +94,7 @@ describe Grape::Validations::PresenceValidator do
|
|
94
94
|
|
95
95
|
get('/', :name => "Bob", :company => "TestCorp")
|
96
96
|
last_response.status.should == 200
|
97
|
-
last_response.body.should == "Hello"
|
97
|
+
last_response.body.should == "Hello".to_json
|
98
98
|
end
|
99
99
|
|
100
100
|
it 'validates nested parameters' do
|
@@ -108,7 +108,7 @@ describe Grape::Validations::PresenceValidator do
|
|
108
108
|
|
109
109
|
get('/nested', :user => {:first_name => "Billy", :last_name => "Bob"})
|
110
110
|
last_response.status.should == 200
|
111
|
-
last_response.body.should == "Nested"
|
111
|
+
last_response.body.should == "Nested".to_json
|
112
112
|
end
|
113
113
|
|
114
114
|
it 'validates triple nested parameters' do
|
@@ -138,7 +138,7 @@ describe Grape::Validations::PresenceValidator do
|
|
138
138
|
|
139
139
|
get('/nested_triple', :admin => { :admin_name => 'admin', :super => {:user => {:first_name => "Billy", :last_name => "Bob"}}})
|
140
140
|
last_response.status.should == 200
|
141
|
-
last_response.body.should == "Nested triple"
|
141
|
+
last_response.body.should == "Nested triple".to_json
|
142
142
|
end
|
143
143
|
|
144
144
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
shared_examples_for 'versioning' do
|
2
2
|
it 'sets the API version' do
|
3
|
+
subject.format :txt
|
3
4
|
subject.version 'v1', macro_options
|
4
5
|
subject.get :hello do
|
5
6
|
"Version: #{request.env['api.version']}"
|
@@ -9,7 +10,8 @@ shared_examples_for 'versioning' do
|
|
9
10
|
end
|
10
11
|
|
11
12
|
it 'adds the prefix before the API version' do
|
12
|
-
subject.
|
13
|
+
subject.format :txt
|
14
|
+
subject.prefix 'api'
|
13
15
|
subject.version 'v1', macro_options
|
14
16
|
subject.get :hello do
|
15
17
|
"Version: #{request.env['api.version']}"
|
@@ -58,6 +60,7 @@ shared_examples_for 'versioning' do
|
|
58
60
|
context 'with different versions for the same endpoint' do
|
59
61
|
context 'without a prefix' do
|
60
62
|
it 'allows the same endpoint to be implemented' do
|
63
|
+
subject.format :txt
|
61
64
|
subject.version 'v2', macro_options
|
62
65
|
subject.get 'version' do
|
63
66
|
request.env['api.version']
|
@@ -79,7 +82,8 @@ shared_examples_for 'versioning' do
|
|
79
82
|
end
|
80
83
|
|
81
84
|
context 'with a prefix' do
|
82
|
-
it 'allows the same endpoint to be implemented' do
|
85
|
+
it 'allows the same endpoint to be implemented' do
|
86
|
+
subject.format :txt
|
83
87
|
subject.prefix 'api'
|
84
88
|
subject.version 'v2', macro_options
|
85
89
|
subject.get 'version' do
|
metadata
CHANGED
@@ -1,294 +1,272 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
4
|
+
version: 0.4.0
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Michael Bleigh
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
16
|
-
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
17
18
|
requirements:
|
18
|
-
- -
|
19
|
+
- - ! '>='
|
19
20
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
21
|
-
|
21
|
+
version: 1.3.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
22
25
|
none: false
|
23
|
-
requirement: !ruby/object:Gem::Requirement
|
24
26
|
requirements:
|
25
|
-
- -
|
27
|
+
- - ! '>='
|
26
28
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
28
|
-
MA==
|
29
|
-
none: false
|
30
|
-
prerelease: false
|
31
|
-
type: :runtime
|
29
|
+
version: 1.3.0
|
32
30
|
- !ruby/object:Gem::Dependency
|
33
31
|
name: rack-mount
|
34
|
-
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
35
34
|
requirements:
|
36
|
-
- -
|
35
|
+
- - ! '>='
|
37
36
|
- !ruby/object:Gem::Version
|
38
|
-
version:
|
39
|
-
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
41
|
none: false
|
41
|
-
requirement: !ruby/object:Gem::Requirement
|
42
42
|
requirements:
|
43
|
-
- -
|
43
|
+
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
46
|
-
MA==
|
47
|
-
none: false
|
48
|
-
prerelease: false
|
49
|
-
type: :runtime
|
45
|
+
version: '0'
|
50
46
|
- !ruby/object:Gem::Dependency
|
51
47
|
name: rack-accept
|
52
|
-
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
53
50
|
requirements:
|
54
|
-
- -
|
51
|
+
- - ! '>='
|
55
52
|
- !ruby/object:Gem::Version
|
56
|
-
version:
|
57
|
-
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
57
|
none: false
|
59
|
-
requirement: !ruby/object:Gem::Requirement
|
60
58
|
requirements:
|
61
|
-
- -
|
59
|
+
- - ! '>='
|
62
60
|
- !ruby/object:Gem::Version
|
63
|
-
version:
|
64
|
-
MA==
|
65
|
-
none: false
|
66
|
-
prerelease: false
|
67
|
-
type: :runtime
|
61
|
+
version: '0'
|
68
62
|
- !ruby/object:Gem::Dependency
|
69
63
|
name: activesupport
|
70
|
-
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
71
66
|
requirements:
|
72
|
-
- -
|
67
|
+
- - ! '>='
|
73
68
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
75
|
-
|
69
|
+
version: '0'
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
76
73
|
none: false
|
77
|
-
requirement: !ruby/object:Gem::Requirement
|
78
74
|
requirements:
|
79
|
-
- -
|
75
|
+
- - ! '>='
|
80
76
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
82
|
-
MA==
|
83
|
-
none: false
|
84
|
-
prerelease: false
|
85
|
-
type: :runtime
|
77
|
+
version: '0'
|
86
78
|
- !ruby/object:Gem::Dependency
|
87
79
|
name: multi_json
|
88
|
-
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
89
82
|
requirements:
|
90
|
-
- -
|
83
|
+
- - ! '>='
|
91
84
|
- !ruby/object:Gem::Version
|
92
85
|
version: 1.3.2
|
86
|
+
type: :runtime
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
89
|
none: false
|
94
|
-
requirement: !ruby/object:Gem::Requirement
|
95
90
|
requirements:
|
96
|
-
- -
|
91
|
+
- - ! '>='
|
97
92
|
- !ruby/object:Gem::Version
|
98
93
|
version: 1.3.2
|
99
|
-
none: false
|
100
|
-
prerelease: false
|
101
|
-
type: :runtime
|
102
94
|
- !ruby/object:Gem::Dependency
|
103
95
|
name: multi_xml
|
104
|
-
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
105
98
|
requirements:
|
106
|
-
- -
|
99
|
+
- - ! '>='
|
107
100
|
- !ruby/object:Gem::Version
|
108
101
|
version: 0.5.2
|
102
|
+
type: :runtime
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
109
105
|
none: false
|
110
|
-
requirement: !ruby/object:Gem::Requirement
|
111
106
|
requirements:
|
112
|
-
- -
|
107
|
+
- - ! '>='
|
113
108
|
- !ruby/object:Gem::Version
|
114
109
|
version: 0.5.2
|
115
|
-
none: false
|
116
|
-
prerelease: false
|
117
|
-
type: :runtime
|
118
110
|
- !ruby/object:Gem::Dependency
|
119
111
|
name: hashie
|
120
|
-
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
121
114
|
requirements:
|
122
|
-
- -
|
115
|
+
- - ! '>='
|
123
116
|
- !ruby/object:Gem::Version
|
124
117
|
version: 1.2.0
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
125
121
|
none: false
|
126
|
-
requirement: !ruby/object:Gem::Requirement
|
127
122
|
requirements:
|
128
|
-
- -
|
123
|
+
- - ! '>='
|
129
124
|
- !ruby/object:Gem::Version
|
130
125
|
version: 1.2.0
|
131
|
-
none: false
|
132
|
-
prerelease: false
|
133
|
-
type: :runtime
|
134
126
|
- !ruby/object:Gem::Dependency
|
135
127
|
name: virtus
|
136
|
-
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
137
130
|
requirements:
|
138
|
-
- -
|
131
|
+
- - ! '>='
|
139
132
|
- !ruby/object:Gem::Version
|
140
|
-
version:
|
141
|
-
|
133
|
+
version: '0'
|
134
|
+
type: :runtime
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
142
137
|
none: false
|
143
|
-
requirement: !ruby/object:Gem::Requirement
|
144
138
|
requirements:
|
145
|
-
- -
|
139
|
+
- - ! '>='
|
146
140
|
- !ruby/object:Gem::Version
|
147
|
-
version:
|
148
|
-
MA==
|
149
|
-
none: false
|
150
|
-
prerelease: false
|
151
|
-
type: :runtime
|
141
|
+
version: '0'
|
152
142
|
- !ruby/object:Gem::Dependency
|
153
143
|
name: builder
|
154
|
-
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
155
146
|
requirements:
|
156
|
-
- -
|
147
|
+
- - ! '>='
|
157
148
|
- !ruby/object:Gem::Version
|
158
|
-
version:
|
159
|
-
|
149
|
+
version: '0'
|
150
|
+
type: :runtime
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
160
153
|
none: false
|
161
|
-
requirement: !ruby/object:Gem::Requirement
|
162
154
|
requirements:
|
163
|
-
- -
|
155
|
+
- - ! '>='
|
164
156
|
- !ruby/object:Gem::Version
|
165
|
-
version:
|
166
|
-
MA==
|
167
|
-
none: false
|
168
|
-
prerelease: false
|
169
|
-
type: :runtime
|
157
|
+
version: '0'
|
170
158
|
- !ruby/object:Gem::Dependency
|
171
159
|
name: grape-entity
|
172
|
-
|
160
|
+
requirement: !ruby/object:Gem::Requirement
|
161
|
+
none: false
|
173
162
|
requirements:
|
174
|
-
- -
|
163
|
+
- - ! '>='
|
175
164
|
- !ruby/object:Gem::Version
|
176
165
|
version: 0.2.0
|
166
|
+
type: :development
|
167
|
+
prerelease: false
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
169
|
none: false
|
178
|
-
requirement: !ruby/object:Gem::Requirement
|
179
170
|
requirements:
|
180
|
-
- -
|
171
|
+
- - ! '>='
|
181
172
|
- !ruby/object:Gem::Version
|
182
173
|
version: 0.2.0
|
183
|
-
none: false
|
184
|
-
prerelease: false
|
185
|
-
type: :development
|
186
174
|
- !ruby/object:Gem::Dependency
|
187
175
|
name: rake
|
188
|
-
|
176
|
+
requirement: !ruby/object:Gem::Requirement
|
177
|
+
none: false
|
189
178
|
requirements:
|
190
|
-
- -
|
179
|
+
- - ! '>='
|
191
180
|
- !ruby/object:Gem::Version
|
192
|
-
version:
|
193
|
-
|
181
|
+
version: '0'
|
182
|
+
type: :development
|
183
|
+
prerelease: false
|
184
|
+
version_requirements: !ruby/object:Gem::Requirement
|
194
185
|
none: false
|
195
|
-
requirement: !ruby/object:Gem::Requirement
|
196
186
|
requirements:
|
197
|
-
- -
|
187
|
+
- - ! '>='
|
198
188
|
- !ruby/object:Gem::Version
|
199
|
-
version:
|
200
|
-
MA==
|
201
|
-
none: false
|
202
|
-
prerelease: false
|
203
|
-
type: :development
|
189
|
+
version: '0'
|
204
190
|
- !ruby/object:Gem::Dependency
|
205
191
|
name: maruku
|
206
|
-
|
192
|
+
requirement: !ruby/object:Gem::Requirement
|
193
|
+
none: false
|
207
194
|
requirements:
|
208
|
-
- -
|
195
|
+
- - ! '>='
|
209
196
|
- !ruby/object:Gem::Version
|
210
|
-
version:
|
211
|
-
|
197
|
+
version: '0'
|
198
|
+
type: :development
|
199
|
+
prerelease: false
|
200
|
+
version_requirements: !ruby/object:Gem::Requirement
|
212
201
|
none: false
|
213
|
-
requirement: !ruby/object:Gem::Requirement
|
214
202
|
requirements:
|
215
|
-
- -
|
203
|
+
- - ! '>='
|
216
204
|
- !ruby/object:Gem::Version
|
217
|
-
version:
|
218
|
-
MA==
|
219
|
-
none: false
|
220
|
-
prerelease: false
|
221
|
-
type: :development
|
205
|
+
version: '0'
|
222
206
|
- !ruby/object:Gem::Dependency
|
223
207
|
name: yard
|
224
|
-
|
208
|
+
requirement: !ruby/object:Gem::Requirement
|
209
|
+
none: false
|
225
210
|
requirements:
|
226
|
-
- -
|
211
|
+
- - ! '>='
|
227
212
|
- !ruby/object:Gem::Version
|
228
|
-
version:
|
229
|
-
|
213
|
+
version: '0'
|
214
|
+
type: :development
|
215
|
+
prerelease: false
|
216
|
+
version_requirements: !ruby/object:Gem::Requirement
|
230
217
|
none: false
|
231
|
-
requirement: !ruby/object:Gem::Requirement
|
232
218
|
requirements:
|
233
|
-
- -
|
219
|
+
- - ! '>='
|
234
220
|
- !ruby/object:Gem::Version
|
235
|
-
version:
|
236
|
-
MA==
|
237
|
-
none: false
|
238
|
-
prerelease: false
|
239
|
-
type: :development
|
221
|
+
version: '0'
|
240
222
|
- !ruby/object:Gem::Dependency
|
241
223
|
name: rack-test
|
242
|
-
|
224
|
+
requirement: !ruby/object:Gem::Requirement
|
225
|
+
none: false
|
243
226
|
requirements:
|
244
|
-
- -
|
227
|
+
- - ! '>='
|
245
228
|
- !ruby/object:Gem::Version
|
246
|
-
version:
|
247
|
-
|
229
|
+
version: '0'
|
230
|
+
type: :development
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
248
233
|
none: false
|
249
|
-
requirement: !ruby/object:Gem::Requirement
|
250
234
|
requirements:
|
251
|
-
- -
|
235
|
+
- - ! '>='
|
252
236
|
- !ruby/object:Gem::Version
|
253
|
-
version:
|
254
|
-
MA==
|
255
|
-
none: false
|
256
|
-
prerelease: false
|
257
|
-
type: :development
|
237
|
+
version: '0'
|
258
238
|
- !ruby/object:Gem::Dependency
|
259
239
|
name: rspec
|
260
|
-
|
240
|
+
requirement: !ruby/object:Gem::Requirement
|
241
|
+
none: false
|
261
242
|
requirements:
|
262
|
-
- -
|
243
|
+
- - ~>
|
263
244
|
- !ruby/object:Gem::Version
|
264
245
|
version: '2.9'
|
246
|
+
type: :development
|
247
|
+
prerelease: false
|
248
|
+
version_requirements: !ruby/object:Gem::Requirement
|
265
249
|
none: false
|
266
|
-
requirement: !ruby/object:Gem::Requirement
|
267
250
|
requirements:
|
268
|
-
- -
|
251
|
+
- - ~>
|
269
252
|
- !ruby/object:Gem::Version
|
270
253
|
version: '2.9'
|
271
|
-
none: false
|
272
|
-
prerelease: false
|
273
|
-
type: :development
|
274
254
|
- !ruby/object:Gem::Dependency
|
275
255
|
name: bundler
|
276
|
-
|
256
|
+
requirement: !ruby/object:Gem::Requirement
|
257
|
+
none: false
|
277
258
|
requirements:
|
278
|
-
- -
|
259
|
+
- - ! '>='
|
279
260
|
- !ruby/object:Gem::Version
|
280
|
-
version:
|
281
|
-
|
261
|
+
version: '0'
|
262
|
+
type: :development
|
263
|
+
prerelease: false
|
264
|
+
version_requirements: !ruby/object:Gem::Requirement
|
282
265
|
none: false
|
283
|
-
requirement: !ruby/object:Gem::Requirement
|
284
266
|
requirements:
|
285
|
-
- -
|
267
|
+
- - ! '>='
|
286
268
|
- !ruby/object:Gem::Version
|
287
|
-
version:
|
288
|
-
MA==
|
289
|
-
none: false
|
290
|
-
prerelease: false
|
291
|
-
type: :development
|
269
|
+
version: '0'
|
292
270
|
description: A Ruby framework for rapid API development with great conventions.
|
293
271
|
email:
|
294
272
|
- michael@intridea.com
|
@@ -296,10 +274,10 @@ executables: []
|
|
296
274
|
extensions: []
|
297
275
|
extra_rdoc_files: []
|
298
276
|
files:
|
299
|
-
-
|
300
|
-
-
|
301
|
-
-
|
302
|
-
-
|
277
|
+
- .gitignore
|
278
|
+
- .rspec
|
279
|
+
- .travis.yml
|
280
|
+
- .yardopts
|
303
281
|
- CHANGELOG.md
|
304
282
|
- Gemfile
|
305
283
|
- Guardfile
|
@@ -342,6 +320,7 @@ files:
|
|
342
320
|
- lib/grape/middleware/versioner/header.rb
|
343
321
|
- lib/grape/middleware/versioner/param.rb
|
344
322
|
- lib/grape/middleware/versioner/path.rb
|
323
|
+
- lib/grape/namespace.rb
|
345
324
|
- lib/grape/parser/base.rb
|
346
325
|
- lib/grape/parser/json.rb
|
347
326
|
- lib/grape/parser/xml.rb
|
@@ -387,65 +366,33 @@ files:
|
|
387
366
|
homepage: https://github.com/intridea/grape
|
388
367
|
licenses:
|
389
368
|
- MIT
|
390
|
-
post_install_message:
|
369
|
+
post_install_message:
|
391
370
|
rdoc_options: []
|
392
371
|
require_paths:
|
393
372
|
- lib
|
394
373
|
required_ruby_version: !ruby/object:Gem::Requirement
|
374
|
+
none: false
|
395
375
|
requirements:
|
396
|
-
- -
|
376
|
+
- - ! '>='
|
397
377
|
- !ruby/object:Gem::Version
|
378
|
+
version: '0'
|
398
379
|
segments:
|
399
380
|
- 0
|
400
|
-
hash:
|
401
|
-
version: !binary |-
|
402
|
-
MA==
|
403
|
-
none: false
|
381
|
+
hash: -881959779
|
404
382
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
383
|
+
none: false
|
405
384
|
requirements:
|
406
|
-
- -
|
385
|
+
- - ! '>='
|
407
386
|
- !ruby/object:Gem::Version
|
387
|
+
version: '0'
|
408
388
|
segments:
|
409
389
|
- 0
|
410
|
-
hash:
|
411
|
-
version: !binary |-
|
412
|
-
MA==
|
413
|
-
none: false
|
390
|
+
hash: -881959779
|
414
391
|
requirements: []
|
415
392
|
rubyforge_project: grape
|
416
393
|
rubygems_version: 1.8.24
|
417
|
-
signing_key:
|
394
|
+
signing_key:
|
418
395
|
specification_version: 3
|
419
396
|
summary: A simple Ruby framework for building REST-like APIs.
|
420
|
-
test_files:
|
421
|
-
|
422
|
-
- spec/grape/endpoint_spec.rb
|
423
|
-
- spec/grape/entity_spec.rb
|
424
|
-
- spec/grape/exceptions/invalid_formatter_spec.rb
|
425
|
-
- spec/grape/exceptions/invalid_versioner_option_spec.rb
|
426
|
-
- spec/grape/exceptions/missing_mime_type_spec.rb
|
427
|
-
- spec/grape/exceptions/missing_option_spec.rb
|
428
|
-
- spec/grape/exceptions/unknown_options_spec.rb
|
429
|
-
- spec/grape/exceptions/unknown_validator_spec.rb
|
430
|
-
- spec/grape/middleware/auth/basic_spec.rb
|
431
|
-
- spec/grape/middleware/auth/digest_spec.rb
|
432
|
-
- spec/grape/middleware/auth/oauth2_spec.rb
|
433
|
-
- spec/grape/middleware/base_spec.rb
|
434
|
-
- spec/grape/middleware/error_spec.rb
|
435
|
-
- spec/grape/middleware/exception_spec.rb
|
436
|
-
- spec/grape/middleware/formatter_spec.rb
|
437
|
-
- spec/grape/middleware/versioner/header_spec.rb
|
438
|
-
- spec/grape/middleware/versioner/param_spec.rb
|
439
|
-
- spec/grape/middleware/versioner/path_spec.rb
|
440
|
-
- spec/grape/middleware/versioner_spec.rb
|
441
|
-
- spec/grape/util/hash_stack_spec.rb
|
442
|
-
- spec/grape/validations/coerce_spec.rb
|
443
|
-
- spec/grape/validations/presence_spec.rb
|
444
|
-
- spec/grape/validations/regexp_spec.rb
|
445
|
-
- spec/grape/validations/zh-CN.yml
|
446
|
-
- spec/grape/validations_spec.rb
|
447
|
-
- spec/shared/versioning_examples.rb
|
448
|
-
- spec/spec_helper.rb
|
449
|
-
- spec/support/basic_auth_encode_helpers.rb
|
450
|
-
- spec/support/versioned_helpers.rb
|
451
|
-
has_rdoc:
|
397
|
+
test_files: []
|
398
|
+
has_rdoc:
|