grape 0.16.2 → 0.17.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.
- checksums.yaml +4 -4
- data/Appraisals +4 -0
- data/CHANGELOG.md +54 -27
- data/Dangerfile +80 -0
- data/Gemfile +23 -0
- data/Gemfile.lock +61 -27
- data/README.md +135 -7
- data/Rakefile +34 -30
- data/UPGRADING.md +21 -0
- data/gemfiles/rack_1.5.2.gemfile +21 -0
- data/gemfiles/rails_3.gemfile +22 -1
- data/gemfiles/rails_4.gemfile +21 -0
- data/gemfiles/rails_5.gemfile +34 -0
- data/grape.gemspec +0 -14
- data/lib/grape.rb +2 -0
- data/lib/grape/api.rb +9 -2
- data/lib/grape/dsl/headers.rb +1 -1
- data/lib/grape/dsl/inside_route.rb +15 -17
- data/lib/grape/dsl/middleware.rb +15 -1
- data/lib/grape/dsl/parameters.rb +16 -14
- data/lib/grape/dsl/request_response.rb +24 -20
- data/lib/grape/dsl/routing.rb +11 -10
- data/lib/grape/dsl/settings.rb +16 -0
- data/lib/grape/endpoint.rb +77 -60
- data/lib/grape/exceptions/validation.rb +5 -2
- data/lib/grape/exceptions/validation_array_errors.rb +11 -0
- data/lib/grape/formatter/xml.rb +1 -1
- data/lib/grape/middleware/error.rb +34 -25
- data/lib/grape/middleware/formatter.rb +9 -9
- data/lib/grape/middleware/stack.rb +110 -0
- data/lib/grape/middleware/versioner.rb +1 -1
- data/lib/grape/middleware/versioner/accept_version_header.rb +1 -1
- data/lib/grape/middleware/versioner/header.rb +3 -3
- data/lib/grape/path.rb +10 -2
- data/lib/grape/request.rb +1 -1
- data/lib/grape/router.rb +10 -19
- data/lib/grape/router/pattern.rb +2 -2
- data/lib/grape/router/route.rb +3 -3
- data/lib/grape/util/content_types.rb +1 -1
- data/lib/grape/util/inheritable_setting.rb +7 -2
- data/lib/grape/util/reverse_stackable_values.rb +45 -0
- data/lib/grape/util/stackable_values.rb +10 -11
- data/lib/grape/validations/attributes_iterator.rb +32 -7
- data/lib/grape/validations/params_scope.rb +33 -21
- data/lib/grape/validations/types.rb +4 -4
- data/lib/grape/validations/types/build_coercer.rb +9 -1
- data/lib/grape/validations/validators/all_or_none.rb +2 -2
- data/lib/grape/validations/validators/allow_blank.rb +10 -11
- data/lib/grape/validations/validators/at_least_one_of.rb +1 -1
- data/lib/grape/validations/validators/base.rb +16 -6
- data/lib/grape/validations/validators/coerce.rb +3 -6
- data/lib/grape/validations/validators/default.rb +26 -1
- data/lib/grape/validations/validators/exactly_one_of.rb +1 -1
- data/lib/grape/validations/validators/mutual_exclusion.rb +1 -1
- data/lib/grape/validations/validators/presence.rb +1 -1
- data/lib/grape/validations/validators/regexp.rb +1 -1
- data/lib/grape/validations/validators/values.rb +1 -1
- data/lib/grape/version.rb +1 -1
- data/spec/grape/api/custom_validations_spec.rb +3 -3
- data/spec/grape/api/parameters_modification_spec.rb +41 -0
- data/spec/grape/api_spec.rb +335 -108
- data/spec/grape/dsl/logger_spec.rb +1 -1
- data/spec/grape/dsl/middleware_spec.rb +25 -5
- data/spec/grape/dsl/request_response_spec.rb +20 -6
- data/spec/grape/dsl/validations_spec.rb +1 -1
- data/spec/grape/endpoint_spec.rb +166 -23
- data/spec/grape/entity_spec.rb +0 -2
- data/spec/grape/exceptions/body_parse_errors_spec.rb +37 -0
- data/spec/grape/exceptions/validation_errors_spec.rb +5 -5
- data/spec/grape/exceptions/validation_spec.rb +10 -0
- data/spec/grape/integration/global_namespace_function_spec.rb +1 -1
- data/spec/grape/integration/rack_spec.rb +1 -1
- data/spec/grape/middleware/base_spec.rb +1 -1
- data/spec/grape/middleware/exception_spec.rb +2 -2
- data/spec/grape/middleware/formatter_spec.rb +4 -4
- data/spec/grape/middleware/stack_spec.rb +123 -0
- data/spec/grape/middleware/versioner/header_spec.rb +6 -6
- data/spec/grape/request_spec.rb +22 -22
- data/spec/grape/util/inheritable_setting_spec.rb +23 -0
- data/spec/grape/util/reverse_stackable_values_spec.rb +131 -0
- data/spec/grape/validations/params_scope_spec.rb +88 -1
- data/spec/grape/validations/validators/allow_blank_spec.rb +5 -0
- data/spec/grape/validations/validators/coerce_spec.rb +5 -5
- data/spec/grape/validations/validators/default_spec.rb +44 -0
- data/spec/grape/validations/validators/values_spec.rb +1 -1
- data/spec/grape/validations_spec.rb +36 -17
- data/spec/spec_helper.rb +1 -8
- data/spec/support/versioned_helpers.rb +3 -3
- metadata +13 -188
- data/gemfiles/rails_3.gemfile.lock +0 -225
- data/pkg/grape-0.16.1.gem +0 -0
- data/pkg/patch.diff +0 -24
- data/tmp/Gemfile.lock +0 -63
@@ -1,225 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: ../
|
3
|
-
specs:
|
4
|
-
grape (0.14.1)
|
5
|
-
activesupport
|
6
|
-
builder
|
7
|
-
hashie (>= 2.1.0)
|
8
|
-
multi_json (>= 1.3.2)
|
9
|
-
multi_xml (>= 0.5.2)
|
10
|
-
rack (>= 1.3.0)
|
11
|
-
rack-accept
|
12
|
-
rack-mount
|
13
|
-
virtus (>= 1.0.0)
|
14
|
-
|
15
|
-
GEM
|
16
|
-
remote: https://rubygems.org/
|
17
|
-
specs:
|
18
|
-
actionmailer (3.2.22)
|
19
|
-
actionpack (= 3.2.22)
|
20
|
-
mail (~> 2.5.4)
|
21
|
-
actionpack (3.2.22)
|
22
|
-
activemodel (= 3.2.22)
|
23
|
-
activesupport (= 3.2.22)
|
24
|
-
builder (~> 3.0.0)
|
25
|
-
erubis (~> 2.7.0)
|
26
|
-
journey (~> 1.0.4)
|
27
|
-
rack (~> 1.4.5)
|
28
|
-
rack-cache (~> 1.2)
|
29
|
-
rack-test (~> 0.6.1)
|
30
|
-
sprockets (~> 2.2.1)
|
31
|
-
activemodel (3.2.22)
|
32
|
-
activesupport (= 3.2.22)
|
33
|
-
builder (~> 3.0.0)
|
34
|
-
activerecord (3.2.22)
|
35
|
-
activemodel (= 3.2.22)
|
36
|
-
activesupport (= 3.2.22)
|
37
|
-
arel (~> 3.0.2)
|
38
|
-
tzinfo (~> 0.3.29)
|
39
|
-
activeresource (3.2.22)
|
40
|
-
activemodel (= 3.2.22)
|
41
|
-
activesupport (= 3.2.22)
|
42
|
-
activesupport (3.2.22)
|
43
|
-
i18n (~> 0.6, >= 0.6.4)
|
44
|
-
multi_json (~> 1.0)
|
45
|
-
appraisal (2.1.0)
|
46
|
-
bundler
|
47
|
-
rake
|
48
|
-
thor (>= 0.14.0)
|
49
|
-
arel (3.0.3)
|
50
|
-
ast (2.2.0)
|
51
|
-
astrolabe (1.3.1)
|
52
|
-
parser (~> 2.2)
|
53
|
-
axiom-types (0.1.1)
|
54
|
-
descendants_tracker (~> 0.0.4)
|
55
|
-
ice_nine (~> 0.11.0)
|
56
|
-
thread_safe (~> 0.3, >= 0.3.1)
|
57
|
-
benchmark-ips (2.3.0)
|
58
|
-
builder (3.0.4)
|
59
|
-
coderay (1.1.0)
|
60
|
-
coercible (1.0.0)
|
61
|
-
descendants_tracker (~> 0.0.1)
|
62
|
-
cookiejar (0.3.2)
|
63
|
-
descendants_tracker (0.0.4)
|
64
|
-
thread_safe (~> 0.3, >= 0.3.1)
|
65
|
-
diff-lcs (1.2.5)
|
66
|
-
equalizer (0.0.11)
|
67
|
-
erubis (2.7.0)
|
68
|
-
ffi (1.9.10)
|
69
|
-
formatador (0.2.5)
|
70
|
-
git-version-bump (0.15.1)
|
71
|
-
grape-entity (0.5.0)
|
72
|
-
activesupport
|
73
|
-
multi_json (>= 1.3.2)
|
74
|
-
guard (2.13.0)
|
75
|
-
formatador (>= 0.2.4)
|
76
|
-
listen (>= 2.7, <= 4.0)
|
77
|
-
lumberjack (~> 1.0)
|
78
|
-
nenv (~> 0.1)
|
79
|
-
notiffany (~> 0.0)
|
80
|
-
pry (>= 0.9.12)
|
81
|
-
shellany (~> 0.0)
|
82
|
-
thor (>= 0.18.1)
|
83
|
-
guard-compat (1.2.1)
|
84
|
-
guard-rspec (4.6.4)
|
85
|
-
guard (~> 2.1)
|
86
|
-
guard-compat (~> 1.1)
|
87
|
-
rspec (>= 2.99.0, < 4.0)
|
88
|
-
guard-rubocop (1.2.0)
|
89
|
-
guard (~> 2.0)
|
90
|
-
rubocop (~> 0.20)
|
91
|
-
hashie (3.4.3)
|
92
|
-
hike (1.2.3)
|
93
|
-
i18n (0.7.0)
|
94
|
-
ice_nine (0.11.1)
|
95
|
-
journey (1.0.4)
|
96
|
-
json (1.8.3)
|
97
|
-
listen (3.0.5)
|
98
|
-
rb-fsevent (>= 0.9.3)
|
99
|
-
rb-inotify (>= 0.9)
|
100
|
-
lumberjack (1.0.10)
|
101
|
-
mail (2.5.4)
|
102
|
-
mime-types (~> 1.16)
|
103
|
-
treetop (~> 1.4.8)
|
104
|
-
maruku (0.7.2)
|
105
|
-
method_source (0.8.2)
|
106
|
-
mime-types (1.25.1)
|
107
|
-
multi_json (1.11.2)
|
108
|
-
multi_xml (0.5.5)
|
109
|
-
nenv (0.2.0)
|
110
|
-
notiffany (0.0.8)
|
111
|
-
nenv (~> 0.1)
|
112
|
-
shellany (~> 0.0)
|
113
|
-
parser (2.2.3.0)
|
114
|
-
ast (>= 1.1, < 3.0)
|
115
|
-
polyglot (0.3.5)
|
116
|
-
powerpack (0.1.1)
|
117
|
-
pry (0.10.3)
|
118
|
-
coderay (~> 1.1.0)
|
119
|
-
method_source (~> 0.8.1)
|
120
|
-
slop (~> 3.4)
|
121
|
-
rack (1.4.7)
|
122
|
-
rack-accept (0.4.5)
|
123
|
-
rack (>= 0.4)
|
124
|
-
rack-cache (1.2)
|
125
|
-
rack (>= 0.4)
|
126
|
-
rack-contrib (1.4.0)
|
127
|
-
git-version-bump (~> 0.15)
|
128
|
-
rack (~> 1.4)
|
129
|
-
rack-mount (0.8.3)
|
130
|
-
rack (>= 1.0.0)
|
131
|
-
rack-ssl (1.3.4)
|
132
|
-
rack
|
133
|
-
rack-test (0.6.3)
|
134
|
-
rack (>= 1.0)
|
135
|
-
rails (3.2.22)
|
136
|
-
actionmailer (= 3.2.22)
|
137
|
-
actionpack (= 3.2.22)
|
138
|
-
activerecord (= 3.2.22)
|
139
|
-
activeresource (= 3.2.22)
|
140
|
-
activesupport (= 3.2.22)
|
141
|
-
bundler (~> 1.0)
|
142
|
-
railties (= 3.2.22)
|
143
|
-
railties (3.2.22)
|
144
|
-
actionpack (= 3.2.22)
|
145
|
-
activesupport (= 3.2.22)
|
146
|
-
rack-ssl (~> 1.3.2)
|
147
|
-
rake (>= 0.8.7)
|
148
|
-
rdoc (~> 3.4)
|
149
|
-
thor (>= 0.14.6, < 2.0)
|
150
|
-
rainbow (2.0.0)
|
151
|
-
rake (10.4.2)
|
152
|
-
rb-fsevent (0.9.7)
|
153
|
-
rb-inotify (0.9.5)
|
154
|
-
ffi (>= 0.5.0)
|
155
|
-
rdoc (3.12.2)
|
156
|
-
json (~> 1.4)
|
157
|
-
rspec (3.4.0)
|
158
|
-
rspec-core (~> 3.4.0)
|
159
|
-
rspec-expectations (~> 3.4.0)
|
160
|
-
rspec-mocks (~> 3.4.0)
|
161
|
-
rspec-core (3.4.1)
|
162
|
-
rspec-support (~> 3.4.0)
|
163
|
-
rspec-expectations (3.4.0)
|
164
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
165
|
-
rspec-support (~> 3.4.0)
|
166
|
-
rspec-mocks (3.4.0)
|
167
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
168
|
-
rspec-support (~> 3.4.0)
|
169
|
-
rspec-support (3.4.1)
|
170
|
-
rubocop (0.35.1)
|
171
|
-
astrolabe (~> 1.3)
|
172
|
-
parser (>= 2.2.3.0, < 3.0)
|
173
|
-
powerpack (~> 0.1)
|
174
|
-
rainbow (>= 1.99.1, < 3.0)
|
175
|
-
ruby-progressbar (~> 1.7)
|
176
|
-
tins (<= 1.6.0)
|
177
|
-
ruby-progressbar (1.7.5)
|
178
|
-
shellany (0.0.1)
|
179
|
-
slop (3.6.0)
|
180
|
-
sprockets (2.2.3)
|
181
|
-
hike (~> 1.2)
|
182
|
-
multi_json (~> 1.0)
|
183
|
-
rack (~> 1.0)
|
184
|
-
tilt (~> 1.1, != 1.3.0)
|
185
|
-
thor (0.19.1)
|
186
|
-
thread_safe (0.3.5)
|
187
|
-
tilt (1.4.1)
|
188
|
-
tins (1.6.0)
|
189
|
-
treetop (1.4.15)
|
190
|
-
polyglot
|
191
|
-
polyglot (>= 0.3.1)
|
192
|
-
tzinfo (0.3.46)
|
193
|
-
virtus (1.0.5)
|
194
|
-
axiom-types (~> 0.1)
|
195
|
-
coercible (~> 1.0)
|
196
|
-
descendants_tracker (~> 0.0, >= 0.0.3)
|
197
|
-
equalizer (~> 0.0, >= 0.0.9)
|
198
|
-
yard (0.8.7.6)
|
199
|
-
|
200
|
-
PLATFORMS
|
201
|
-
ruby
|
202
|
-
|
203
|
-
DEPENDENCIES
|
204
|
-
appraisal
|
205
|
-
benchmark-ips
|
206
|
-
bundler
|
207
|
-
cookiejar
|
208
|
-
grape!
|
209
|
-
grape-entity (>= 0.4.4)
|
210
|
-
guard
|
211
|
-
guard-rspec
|
212
|
-
guard-rubocop
|
213
|
-
maruku
|
214
|
-
mime-types (< 3.0)
|
215
|
-
rack-cache (<= 1.2)
|
216
|
-
rack-contrib
|
217
|
-
rack-test
|
218
|
-
rails (= 3.2.22)
|
219
|
-
rake
|
220
|
-
rspec (~> 3.0)
|
221
|
-
rubocop (= 0.35.1)
|
222
|
-
yard
|
223
|
-
|
224
|
-
BUNDLED WITH
|
225
|
-
1.11.2
|
data/pkg/grape-0.16.1.gem
DELETED
Binary file
|
data/pkg/patch.diff
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
diff --git lib/grape/router/route.rb lib/grape/router/route.rb
|
2
|
-
index 643960d..1074c01 100644
|
3
|
-
--- lib/grape/router/route.rb
|
4
|
-
+++ lib/grape/router/route.rb
|
5
|
-
@@ -20,7 +20,9 @@ module Grape
|
6
|
-
:entity,
|
7
|
-
:details,
|
8
|
-
:requirements,
|
9
|
-
- :request_method
|
10
|
-
+ :request_method,
|
11
|
-
+ :hidden,
|
12
|
-
+ :params
|
13
|
-
].freeze
|
14
|
-
|
15
|
-
attr_accessor :pattern, :translator, :app, :index, :regexp
|
16
|
-
@@ -42,7 +44,7 @@ module Grape
|
17
|
-
if match
|
18
|
-
method_name = match.captures.last.to_sym
|
19
|
-
warn_route_methods(method_name, caller(1).shift)
|
20
|
-
- @options[method_name]
|
21
|
-
+ respond_to?(method_name) ? send(method_name) : @options[method_name]
|
22
|
-
else
|
23
|
-
super
|
24
|
-
end
|
data/tmp/Gemfile.lock
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
GIT
|
2
|
-
remote: git://github.com/ruby-grape/grape.git
|
3
|
-
revision: 951ae51cc0eccec6c5225c2aaf16f091829062dd
|
4
|
-
specs:
|
5
|
-
grape (0.14.1)
|
6
|
-
activesupport
|
7
|
-
builder
|
8
|
-
hashie (>= 2.1.0)
|
9
|
-
multi_json (>= 1.3.2)
|
10
|
-
multi_xml (>= 0.5.2)
|
11
|
-
rack (>= 1.3.0)
|
12
|
-
rack-accept
|
13
|
-
rack-mount
|
14
|
-
virtus (>= 1.0.0)
|
15
|
-
|
16
|
-
GEM
|
17
|
-
remote: https://rubygems.org/
|
18
|
-
specs:
|
19
|
-
activesupport (4.2.5)
|
20
|
-
i18n (~> 0.7)
|
21
|
-
json (~> 1.7, >= 1.7.7)
|
22
|
-
minitest (~> 5.1)
|
23
|
-
thread_safe (~> 0.3, >= 0.3.4)
|
24
|
-
tzinfo (~> 1.1)
|
25
|
-
axiom-types (0.1.1)
|
26
|
-
descendants_tracker (~> 0.0.4)
|
27
|
-
ice_nine (~> 0.11.0)
|
28
|
-
thread_safe (~> 0.3, >= 0.3.1)
|
29
|
-
builder (3.2.2)
|
30
|
-
coercible (1.0.0)
|
31
|
-
descendants_tracker (~> 0.0.1)
|
32
|
-
descendants_tracker (0.0.4)
|
33
|
-
thread_safe (~> 0.3, >= 0.3.1)
|
34
|
-
equalizer (0.0.11)
|
35
|
-
hashie (3.4.3)
|
36
|
-
i18n (0.7.0)
|
37
|
-
ice_nine (0.11.1)
|
38
|
-
json (1.8.3)
|
39
|
-
minitest (5.8.3)
|
40
|
-
multi_json (1.11.2)
|
41
|
-
multi_xml (0.5.5)
|
42
|
-
rack (1.6.4)
|
43
|
-
rack-accept (0.4.5)
|
44
|
-
rack (>= 0.4)
|
45
|
-
rack-mount (0.8.3)
|
46
|
-
rack (>= 1.0.0)
|
47
|
-
thread_safe (0.3.5)
|
48
|
-
tzinfo (1.2.2)
|
49
|
-
thread_safe (~> 0.1)
|
50
|
-
virtus (1.0.5)
|
51
|
-
axiom-types (~> 0.1)
|
52
|
-
coercible (~> 1.0)
|
53
|
-
descendants_tracker (~> 0.0, >= 0.0.3)
|
54
|
-
equalizer (~> 0.0, >= 0.0.9)
|
55
|
-
|
56
|
-
PLATFORMS
|
57
|
-
ruby
|
58
|
-
|
59
|
-
DEPENDENCIES
|
60
|
-
grape!
|
61
|
-
|
62
|
-
BUNDLED WITH
|
63
|
-
1.10.6
|