actionpack-direct_routes 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89701bacada4a996ccac6559e646f16076e37844
4
- data.tar.gz: f57814f01be6a26acd88d2fcbb8262b8c74b0cc4
3
+ metadata.gz: a50d92b9b2612e7e509092199f4b3b3e2579739c
4
+ data.tar.gz: 843d1ef1b97141f48430383f05342295cac18588
5
5
  SHA512:
6
- metadata.gz: 96af7efb398c1d54bd5aa732a8397bc65963da5712f38157e52b88793dba6999e0e6cf4c8505b3db1294cd49c40799868fb32adb827e389816cc6996b7d63cc9
7
- data.tar.gz: ef73278154f31252693c8ee83ea6236d1d96c27e670de23160b31cd9c6604ed9d5495aeeb97aea9da8f00371cf2f3dd0997cf426c5588d24c0952b9fe07f959f
6
+ metadata.gz: 05cf6ba77aa7eeee0b46a8022b44eb275630692b4bf94fe85ef7403860997a7b4c4b3e69e1652395e05d37f532c3dd9b8e959acd9311c7d12e9aa1be788e4125
7
+ data.tar.gz: 15e429e2b3ca72c0ad2aa745bd18fda1810e17fcb5fd5a3aacdbd8cf996cdc0aeeb7a87af5ebcfabc45640e9b228ee63628f5940e293fdcd5dde8107d559ce55
data/README.md CHANGED
@@ -33,10 +33,6 @@ end
33
33
 
34
34
  For details to [Rails Routing from the Outside In — Ruby on Rails Guides](https://guides.rubyonrails.org/routing.html#direct-routes)
35
35
 
36
-
37
- ## Limitation
38
- You can backport Direct routes into Rails 4.2 only now.
39
-
40
36
  ## Contributing
41
37
  Bug reports and pull requests are welcome on GitHub at https://github.com/hamuyuuki/actionpack-direct_routes. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
42
38
 
@@ -5,8 +5,12 @@ module ActionDispatch
5
5
  module DirectRoutes
6
6
  module Mapper
7
7
  module Scope
8
+ def null?
9
+ @hash.nil? && @parent.nil?
10
+ end
11
+
8
12
  def root?
9
- @parent == {}
13
+ @parent == {} || @parent.null?
10
14
  end
11
15
  end
12
16
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActionPack
4
4
  module DirectRoutes
5
- VERSION = "0.2.0"
5
+ VERSION = "0.3.0"
6
6
  end
7
7
  end
@@ -0,0 +1,2 @@
1
+ DEPRECATION WARNING: ActiveRecord::Base.raise_in_transactional_callbacks= is deprecated, has no effect and will be removed without replacement. (called from require at test/dummy/bin/rails:4)
2
+ DEPRECATION WARNING: ActiveRecord::Base.raise_in_transactional_callbacks= is deprecated, has no effect and will be removed without replacement. (called from require at test/dummy/bin/rails:4)
@@ -3,110 +3,140 @@
3
3
  CustomUrlHelpersTest: test_defining_direct_inside_a_scope_raises_runtime_error
4
4
  ------------------------------------------------------------------------------
5
5
   (0.1ms) rollback transaction
6
-  (0.1ms) begin transaction
6
+  (0.3ms) begin transaction
7
+ ----------------------------------------------------------------------
8
+ CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
9
+ ----------------------------------------------------------------------
10
+  (0.0ms) rollback transaction
11
+  (0.0ms) begin transaction
7
12
  ---------------------------------------
8
13
  CustomUrlHelpersTest: test_direct_paths
9
14
  ---------------------------------------
10
-  (0.1ms) rollback transaction
11
-  (0.1ms) begin transaction
15
+  (0.0ms) rollback transaction
16
+  (0.0ms) begin transaction
12
17
  --------------------------------------
13
18
  CustomUrlHelpersTest: test_direct_urls
14
19
  --------------------------------------
20
+  (0.0ms) rollback transaction
21
+  (0.2ms) begin transaction
22
+ ---------------------------------------------------------
23
+ RoutingTest: test_named_routes_are_cleared_when_reloading
24
+ ---------------------------------------------------------
25
+  (0.2ms) begin transaction
26
+ -----------------------------------------------------------------------------
27
+ RoutingTest: test_reloads_routes_when_configuration_is_changed_in_development
28
+ -----------------------------------------------------------------------------
15
29
   (0.1ms) rollback transaction
16
-  (0.1ms) begin transaction
17
- ----------------------------------------------------------------------
18
- CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
19
- ----------------------------------------------------------------------
20
-  (0.1ms) rollback transaction
30
+  (0.3ms) rollback transaction
31
+  (0.3ms) begin transaction
32
+ ----------------------------------------------------------------------------
33
+ RoutingTest: test_reloads_routes_when_configuration_is_changed_in_production
34
+ ----------------------------------------------------------------------------
21
35
   (0.2ms) begin transaction
22
- ---------------------------------------
23
- CustomUrlHelpersTest: test_direct_paths
24
- ---------------------------------------
25
-  (1.0ms) rollback transaction
26
-  (0.1ms) begin transaction
36
+ -------------------------------------------------------------
37
+ RoutingTest: test_routes_are_added_and_removed_when_reloading
38
+ -------------------------------------------------------------
39
+  (0.1ms) rollback transaction
40
+  (0.1ms) rollback transaction
41
+  (0.9ms) begin transaction
27
42
  --------------------------------------
28
43
  CustomUrlHelpersTest: test_direct_urls
29
44
  --------------------------------------
30
-  (0.1ms) rollback transaction
31
45
   (0.4ms) begin transaction
32
46
  ----------------------------------------------------------------------
33
47
  CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
34
48
  ----------------------------------------------------------------------
35
49
   (0.1ms) rollback transaction
36
-  (0.1ms) begin transaction
50
+  (0.1ms) rollback transaction
51
+  (0.4ms) begin transaction
52
+ ---------------------------------------
53
+ CustomUrlHelpersTest: test_direct_paths
54
+ ---------------------------------------
55
+  (0.4ms) begin transaction
37
56
  ------------------------------------------------------------------------------
38
57
  CustomUrlHelpersTest: test_defining_direct_inside_a_scope_raises_runtime_error
39
58
  ------------------------------------------------------------------------------
59
+  (0.1ms) rollback transaction
40
60
   (0.1ms) rollback transaction
41
61
   (0.1ms) begin transaction
42
62
  ----------------------------------------------------------------------
43
63
  CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
44
64
  ----------------------------------------------------------------------
45
-  (0.1ms) rollback transaction
65
+  (0.0ms) rollback transaction
66
+  (0.0ms) begin transaction
67
+ --------------------------------------
68
+ CustomUrlHelpersTest: test_direct_urls
69
+ --------------------------------------
70
+  (0.0ms) rollback transaction
46
71
   (0.1ms) begin transaction
47
72
  ------------------------------------------------------------------------------
48
73
  CustomUrlHelpersTest: test_defining_direct_inside_a_scope_raises_runtime_error
49
74
  ------------------------------------------------------------------------------
50
75
   (0.1ms) rollback transaction
51
-  (0.1ms) begin transaction
52
- --------------------------------------
53
- CustomUrlHelpersTest: test_direct_urls
54
- --------------------------------------
55
-  (0.1ms) rollback transaction
56
-  (0.3ms) begin transaction
76
+  (0.2ms) begin transaction
57
77
  ---------------------------------------
58
78
  CustomUrlHelpersTest: test_direct_paths
59
79
  ---------------------------------------
80
+  (0.0ms) rollback transaction
81
+  (0.3ms) begin transaction
82
+ ---------------------------------------------------------
83
+ RoutingTest: test_named_routes_are_cleared_when_reloading
84
+ ---------------------------------------------------------
85
+  (0.3ms) begin transaction
86
+ ----------------------------------------------------------------------------
87
+ RoutingTest: test_reloads_routes_when_configuration_is_changed_in_production
88
+ ----------------------------------------------------------------------------
60
89
   (0.1ms) rollback transaction
61
-  (0.1ms) begin transaction
90
+  (0.1ms) rollback transaction
91
+  (0.3ms) begin transaction
92
+ -----------------------------------------------------------------------------
93
+ RoutingTest: test_reloads_routes_when_configuration_is_changed_in_development
94
+ -----------------------------------------------------------------------------
95
+  (0.3ms) begin transaction
96
+ -------------------------------------------------------------
97
+ RoutingTest: test_routes_are_added_and_removed_when_reloading
98
+ -------------------------------------------------------------
99
+  (0.2ms) rollback transaction
100
+  (0.1ms) rollback transaction
101
+  (0.3ms) begin transaction
102
+ ----------------------------------------------------------------------
103
+ CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
104
+ ----------------------------------------------------------------------
105
+  (1.0ms) begin transaction
62
106
  ---------------------------------------
63
107
  CustomUrlHelpersTest: test_direct_paths
64
108
  ---------------------------------------
109
+  (0.1ms) rollback transaction
65
110
   (0.1ms) rollback transaction
66
111
   (0.3ms) begin transaction
67
112
  --------------------------------------
68
113
  CustomUrlHelpersTest: test_direct_urls
69
114
  --------------------------------------
70
-  (0.1ms) rollback transaction
71
-  (0.5ms) begin transaction
115
+  (0.3ms) begin transaction
72
116
  ------------------------------------------------------------------------------
73
117
  CustomUrlHelpersTest: test_defining_direct_inside_a_scope_raises_runtime_error
74
118
  ------------------------------------------------------------------------------
75
119
   (0.1ms) rollback transaction
76
-  (0.0ms) begin transaction
77
- ----------------------------------------------------------------------
78
- CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
79
- ----------------------------------------------------------------------
80
-  (0.1ms) rollback transaction
81
-  (0.1ms) begin transaction
82
- ----------------------------------------------------------------------
83
- CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
84
- ----------------------------------------------------------------------
85
120
   (0.1ms) rollback transaction
86
-  (0.1ms) begin transaction
121
+  (0.5ms) begin transaction
122
+  (0.4ms) begin transaction
87
123
  --------------------------------------
88
124
  CustomUrlHelpersTest: test_direct_urls
89
125
  --------------------------------------
90
-  (0.0ms) rollback transaction
91
-  (0.1ms) begin transaction
92
- ------------------------------------------------------------------------------
93
- CustomUrlHelpersTest: test_defining_direct_inside_a_scope_raises_runtime_error
94
- ------------------------------------------------------------------------------
95
-  (0.1ms) rollback transaction
96
-  (0.1ms) begin transaction
97
126
  ---------------------------------------
98
127
  CustomUrlHelpersTest: test_direct_paths
99
128
  ---------------------------------------
100
129
   (0.1ms) rollback transaction
101
-  (0.1ms) begin transaction
130
+  (0.1ms) rollback transaction
131
+  (0.3ms) begin transaction
102
132
  ------------------------------------------------------------------------------
103
133
  CustomUrlHelpersTest: test_defining_direct_inside_a_scope_raises_runtime_error
104
134
  ------------------------------------------------------------------------------
105
-  (0.3ms) rollback transaction
106
-  (0.0ms) begin transaction
107
- ---------------------------------------
108
- CustomUrlHelpersTest: test_direct_paths
109
- ---------------------------------------
135
+  (1.0ms) begin transaction
136
+ ----------------------------------------------------------------------
137
+ CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
138
+ ----------------------------------------------------------------------
139
+  (0.1ms) rollback transaction
110
140
   (0.0ms) rollback transaction
111
141
   (0.1ms) begin transaction
112
142
  --------------------------------------
@@ -114,140 +144,240 @@ CustomUrlHelpersTest: test_direct_urls
114
144
  --------------------------------------
115
145
   (0.1ms) rollback transaction
116
146
   (0.0ms) begin transaction
117
- ----------------------------------------------------------------------
118
- CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
119
- ----------------------------------------------------------------------
120
-  (0.1ms) rollback transaction
121
-  (0.1ms) begin transaction
122
147
  ------------------------------------------------------------------------------
123
148
  CustomUrlHelpersTest: test_defining_direct_inside_a_scope_raises_runtime_error
124
149
  ------------------------------------------------------------------------------
125
-  (0.1ms) rollback transaction
150
+  (0.0ms) rollback transaction
126
151
   (0.1ms) begin transaction
127
152
  ---------------------------------------
128
153
  CustomUrlHelpersTest: test_direct_paths
129
154
  ---------------------------------------
130
155
   (0.1ms) rollback transaction
131
-  (0.1ms) begin transaction
156
+  (0.2ms) begin transaction
132
157
  ----------------------------------------------------------------------
133
158
  CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
134
159
  ----------------------------------------------------------------------
135
-  (0.1ms) rollback transaction
136
-  (0.1ms) begin transaction
137
- --------------------------------------
138
- CustomUrlHelpersTest: test_direct_urls
139
- --------------------------------------
140
-  (0.1ms) rollback transaction
141
-  (0.1ms) begin transaction
160
+  (0.0ms) rollback transaction
161
+  (0.1ms) begin transaction
162
+ ------------------------------------------------------------------------------
163
+ CustomUrlHelpersTest: test_defining_direct_inside_a_scope_raises_runtime_error
164
+ ------------------------------------------------------------------------------
165
+  (0.2ms) rollback transaction
166
+  (0.1ms) begin transaction
167
+ ----------------------------------------------------------------------
168
+ CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
169
+ ----------------------------------------------------------------------
170
+  (0.0ms) rollback transaction
171
+  (0.1ms) begin transaction
142
172
  --------------------------------------
143
173
  CustomUrlHelpersTest: test_direct_urls
144
174
  --------------------------------------
145
-  (0.1ms) rollback transaction
146
-  (0.0ms) begin transaction
175
+  (0.0ms) rollback transaction
176
+  (0.0ms) begin transaction
177
+ ---------------------------------------
178
+ CustomUrlHelpersTest: test_direct_paths
179
+ ---------------------------------------
180
+  (0.0ms) rollback transaction
181
+  (0.1ms) begin transaction
182
+ ---------------------------------------
183
+ CustomUrlHelpersTest: test_direct_paths
184
+ ---------------------------------------
185
+  (0.1ms) rollback transaction
186
+  (0.1ms) begin transaction
187
+ ---------------------------------------
188
+ CustomUrlHelpersTest: test_direct_paths
189
+ ---------------------------------------
190
+  (0.1ms) rollback transaction
191
+  (0.1ms) begin transaction
192
+ ---------------------------------------
193
+ CustomUrlHelpersTest: test_direct_paths
194
+ ---------------------------------------
195
+  (0.1ms) rollback transaction
196
+  (0.1ms) begin transaction
197
+ ---------------------------------------
198
+ CustomUrlHelpersTest: test_direct_paths
199
+ ---------------------------------------
200
+  (0.1ms) rollback transaction
201
+  (0.3ms) begin transaction
202
+ ---------------------------------------
203
+ CustomUrlHelpersTest: test_direct_paths
204
+ ---------------------------------------
205
+  (0.1ms) rollback transaction
206
+  (0.1ms) begin transaction
207
+ ---------------------------------------
208
+ CustomUrlHelpersTest: test_direct_paths
209
+ ---------------------------------------
210
+  (0.1ms) rollback transaction
211
+  (0.1ms) begin transaction
212
+ ---------------------------------------
213
+ CustomUrlHelpersTest: test_direct_paths
214
+ ---------------------------------------
215
+  (0.1ms) rollback transaction
216
+  (0.1ms) begin transaction
217
+ ---------------------------------------
218
+ CustomUrlHelpersTest: test_direct_paths
219
+ ---------------------------------------
220
+  (0.1ms) rollback transaction
221
+  (0.1ms) begin transaction
222
+ ---------------------------------------
223
+ CustomUrlHelpersTest: test_direct_paths
224
+ ---------------------------------------
225
+  (0.1ms) rollback transaction
226
+  (0.1ms) begin transaction
227
+ ---------------------------------------
228
+ CustomUrlHelpersTest: test_direct_paths
229
+ ---------------------------------------
230
+  (0.1ms) rollback transaction
231
+  (0.1ms) begin transaction
232
+ ---------------------------------------
233
+ CustomUrlHelpersTest: test_direct_paths
234
+ ---------------------------------------
235
+  (0.1ms) rollback transaction
236
+  (0.1ms) begin transaction
237
+ ---------------------------------------
238
+ CustomUrlHelpersTest: test_direct_paths
239
+ ---------------------------------------
240
+  (0.1ms) rollback transaction
241
+  (0.1ms) begin transaction
242
+ ---------------------------------------
243
+ CustomUrlHelpersTest: test_direct_paths
244
+ ---------------------------------------
245
+  (0.1ms) rollback transaction
246
+  (0.1ms) begin transaction
247
+ ---------------------------------------
248
+ CustomUrlHelpersTest: test_direct_paths
249
+ ---------------------------------------
250
+  (0.1ms) rollback transaction
251
+  (0.1ms) begin transaction
147
252
  ----------------------------------------------------------------------
148
253
  CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
149
254
  ----------------------------------------------------------------------
150
-  (0.1ms) rollback transaction
151
-  (0.2ms) begin transaction
255
+  (0.1ms) rollback transaction
256
+  (0.0ms) begin transaction
257
+ ---------------------------------------
258
+ CustomUrlHelpersTest: test_direct_paths
259
+ ---------------------------------------
260
+  (0.0ms) rollback transaction
261
+  (0.0ms) begin transaction
152
262
  ------------------------------------------------------------------------------
153
263
  CustomUrlHelpersTest: test_defining_direct_inside_a_scope_raises_runtime_error
154
264
  ------------------------------------------------------------------------------
155
-  (0.1ms) rollback transaction
156
-  (0.1ms) begin transaction
265
+  (0.3ms) rollback transaction
266
+  (0.0ms) begin transaction
267
+ --------------------------------------
268
+ CustomUrlHelpersTest: test_direct_urls
269
+ --------------------------------------
270
+  (0.0ms) rollback transaction
271
+  (0.2ms) begin transaction
272
+ ----------------------------------------------------------------------
273
+ CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
274
+ ----------------------------------------------------------------------
275
+  (0.1ms) rollback transaction
276
+  (0.0ms) begin transaction
157
277
  ---------------------------------------
158
278
  CustomUrlHelpersTest: test_direct_paths
159
279
  ---------------------------------------
160
-  (0.1ms) rollback transaction
161
-  (0.1ms) begin transaction
280
+  (0.1ms) rollback transaction
281
+  (0.1ms) begin transaction
162
282
  ------------------------------------------------------------------------------
163
283
  CustomUrlHelpersTest: test_defining_direct_inside_a_scope_raises_runtime_error
164
284
  ------------------------------------------------------------------------------
165
-  (0.1ms) rollback transaction
166
-  (0.1ms) begin transaction
285
+  (1.0ms) rollback transaction
286
+  (0.0ms) begin transaction
287
+ --------------------------------------
288
+ CustomUrlHelpersTest: test_direct_urls
289
+ --------------------------------------
290
+  (0.3ms) rollback transaction
291
+  (0.1ms) begin transaction
167
292
  ---------------------------------------
168
293
  CustomUrlHelpersTest: test_direct_paths
169
294
  ---------------------------------------
170
-  (0.1ms) rollback transaction
171
-  (0.1ms) begin transaction
295
+  (0.1ms) rollback transaction
296
+  (0.3ms) begin transaction
297
+ ----------------------------------------------------------------------
298
+ CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
299
+ ----------------------------------------------------------------------
300
+  (0.0ms) rollback transaction
301
+  (0.1ms) begin transaction
172
302
  --------------------------------------
173
303
  CustomUrlHelpersTest: test_direct_urls
174
304
  --------------------------------------
175
-  (0.1ms) rollback transaction
176
-  (0.1ms) begin transaction
305
+  (0.1ms) rollback transaction
306
+  (0.1ms) begin transaction
307
+ ------------------------------------------------------------------------------
308
+ CustomUrlHelpersTest: test_defining_direct_inside_a_scope_raises_runtime_error
309
+ ------------------------------------------------------------------------------
310
+  (0.1ms) rollback transaction
311
+  (0.1ms) begin transaction
177
312
  ----------------------------------------------------------------------
178
313
  CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
179
314
  ----------------------------------------------------------------------
180
-  (0.1ms) rollback transaction
181
-  (0.3ms) begin transaction
182
- ----------------------------------------------------------------------------
183
- RoutingTest: test_reloads_routes_when_configuration_is_changed_in_production
184
- ----------------------------------------------------------------------------
185
-  (0.2ms) begin transaction
186
- -----------------------------------------------------------------------------
187
- RoutingTest: test_reloads_routes_when_configuration_is_changed_in_development
188
- -----------------------------------------------------------------------------
189
-  (0.1ms) rollback transaction
190
-  (0.1ms) rollback transaction
191
-  (0.2ms) begin transaction
192
- -------------------------------------------------------------
193
- RoutingTest: test_routes_are_added_and_removed_when_reloading
194
- -------------------------------------------------------------
195
-  (0.4ms) begin transaction
196
- ---------------------------------------------------------
197
- RoutingTest: test_named_routes_are_cleared_when_reloading
198
- ---------------------------------------------------------
199
-  (0.1ms) rollback transaction
200
-  (0.0ms) rollback transaction
201
-  (0.1ms) begin transaction
315
+  (0.1ms) rollback transaction
316
+  (0.0ms) begin transaction
317
+ ---------------------------------------
318
+ CustomUrlHelpersTest: test_direct_paths
319
+ ---------------------------------------
320
+  (0.0ms) rollback transaction
321
+  (0.0ms) begin transaction
202
322
  ------------------------------------------------------------------------------
203
323
  CustomUrlHelpersTest: test_defining_direct_inside_a_scope_raises_runtime_error
204
324
  ------------------------------------------------------------------------------
205
-  (0.1ms) rollback transaction
206
-  (0.0ms) begin transaction
325
+  (0.0ms) rollback transaction
326
+  (0.0ms) begin transaction
207
327
  --------------------------------------
208
328
  CustomUrlHelpersTest: test_direct_urls
209
329
  --------------------------------------
210
-  (0.1ms) rollback transaction
211
-  (0.1ms) begin transaction
330
+  (0.0ms) rollback transaction
331
+  (0.1ms) begin transaction
332
+ ------------------------------------------------------------------------------
333
+ CustomUrlHelpersTest: test_defining_direct_inside_a_scope_raises_runtime_error
334
+ ------------------------------------------------------------------------------
335
+  (0.1ms) rollback transaction
336
+  (0.0ms) begin transaction
337
+ ----------------------------------------------------------------------
338
+ CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
339
+ ----------------------------------------------------------------------
340
+  (0.0ms) rollback transaction
341
+  (0.0ms) begin transaction
342
+ --------------------------------------
343
+ CustomUrlHelpersTest: test_direct_urls
344
+ --------------------------------------
345
+  (0.0ms) rollback transaction
346
+  (0.0ms) begin transaction
212
347
  ---------------------------------------
213
348
  CustomUrlHelpersTest: test_direct_paths
214
349
  ---------------------------------------
215
-  (0.1ms) rollback transaction
350
+  (0.0ms) rollback transaction
216
351
   (0.2ms) begin transaction
217
352
  ----------------------------------------------------------------------
218
353
  CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
219
354
  ----------------------------------------------------------------------
220
-  (0.1ms) rollback transaction
221
-  (0.1ms) begin transaction
222
- ------------------------------------------------------------------------------
223
- CustomUrlHelpersTest: test_defining_direct_inside_a_scope_raises_runtime_error
224
- ------------------------------------------------------------------------------
225
355
   (0.1ms) rollback transaction
226
356
   (0.0ms) begin transaction
227
- ----------------------------------------------------------------------
228
- CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
229
- ----------------------------------------------------------------------
230
-  (0.1ms) rollback transaction
231
-  (0.1ms) begin transaction
232
357
  ---------------------------------------
233
358
  CustomUrlHelpersTest: test_direct_paths
234
359
  ---------------------------------------
235
-  (0.1ms) rollback transaction
360
+  (0.0ms) rollback transaction
361
+  (0.0ms) begin transaction
362
+ ------------------------------------------------------------------------------
363
+ CustomUrlHelpersTest: test_defining_direct_inside_a_scope_raises_runtime_error
364
+ ------------------------------------------------------------------------------
365
+  (0.0ms) rollback transaction
236
366
   (0.0ms) begin transaction
237
367
  --------------------------------------
238
368
  CustomUrlHelpersTest: test_direct_urls
239
369
  --------------------------------------
240
-  (0.1ms) rollback transaction
370
+  (0.0ms) rollback transaction
241
371
   (0.1ms) begin transaction
242
372
  ------------------------------------------------------------------------------
243
373
  CustomUrlHelpersTest: test_defining_direct_inside_a_scope_raises_runtime_error
244
374
  ------------------------------------------------------------------------------
245
-  (0.1ms) rollback transaction
246
-  (0.2ms) begin transaction
375
+  (0.0ms) rollback transaction
376
+  (0.0ms) begin transaction
247
377
  ----------------------------------------------------------------------
248
378
  CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
249
379
  ----------------------------------------------------------------------
250
-  (0.2ms) rollback transaction
380
+  (0.0ms) rollback transaction
251
381
   (0.1ms) begin transaction
252
382
  ---------------------------------------
253
383
  CustomUrlHelpersTest: test_direct_paths
@@ -257,83 +387,118 @@ CustomUrlHelpersTest: test_direct_paths
257
387
  --------------------------------------
258
388
  CustomUrlHelpersTest: test_direct_urls
259
389
  --------------------------------------
260
-  (0.1ms) rollback transaction
390
+  (0.0ms) rollback transaction
261
391
   (0.1ms) begin transaction
392
+ --------------------------------------
393
+ CustomUrlHelpersTest: test_direct_urls
394
+ --------------------------------------
395
+  (0.1ms) rollback transaction
396
+  (0.3ms) begin transaction
262
397
  ------------------------------------------------------------------------------
263
398
  CustomUrlHelpersTest: test_defining_direct_inside_a_scope_raises_runtime_error
264
399
  ------------------------------------------------------------------------------
265
-  (0.1ms) rollback transaction
266
-  (0.3ms) begin transaction
267
- ---------------------------------------
268
- CustomUrlHelpersTest: test_direct_paths
269
- ---------------------------------------
270
-  (0.1ms) rollback transaction
271
-  (0.7ms) begin transaction
400
+  (0.0ms) rollback transaction
401
+  (0.0ms) begin transaction
272
402
  ----------------------------------------------------------------------
273
403
  CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
274
404
  ----------------------------------------------------------------------
275
-  (0.1ms) rollback transaction
405
+  (0.0ms) rollback transaction
406
+  (0.0ms) begin transaction
407
+ ---------------------------------------
408
+ CustomUrlHelpersTest: test_direct_paths
409
+ ---------------------------------------
410
+  (0.0ms) rollback transaction
276
411
   (0.1ms) begin transaction
277
412
  --------------------------------------
278
413
  CustomUrlHelpersTest: test_direct_urls
279
414
  --------------------------------------
280
-  (0.4ms) rollback transaction
415
+  (0.1ms) rollback transaction
281
416
   (0.1ms) begin transaction
282
417
  ------------------------------------------------------------------------------
283
418
  CustomUrlHelpersTest: test_defining_direct_inside_a_scope_raises_runtime_error
284
419
  ------------------------------------------------------------------------------
285
-  (0.1ms) rollback transaction
286
-  (0.1ms) begin transaction
420
+  (0.0ms) rollback transaction
421
+  (0.0ms) begin transaction
287
422
  ----------------------------------------------------------------------
288
423
  CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
289
424
  ----------------------------------------------------------------------
290
-  (0.5ms) rollback transaction
425
+  (0.0ms) rollback transaction
426
+  (0.0ms) begin transaction
427
+ ---------------------------------------
428
+ CustomUrlHelpersTest: test_direct_paths
429
+ ---------------------------------------
430
+  (0.0ms) rollback transaction
291
431
   (0.1ms) begin transaction
292
432
  ---------------------------------------
293
433
  CustomUrlHelpersTest: test_direct_paths
294
434
  ---------------------------------------
295
435
   (0.1ms) rollback transaction
296
-  (0.2ms) begin transaction
436
+  (0.0ms) begin transaction
297
437
  --------------------------------------
298
438
  CustomUrlHelpersTest: test_direct_urls
299
439
  --------------------------------------
300
-  (0.1ms) rollback transaction
301
-  (0.1ms) begin transaction
440
+  (0.0ms) rollback transaction
441
+  (0.0ms) begin transaction
302
442
  ------------------------------------------------------------------------------
303
443
  CustomUrlHelpersTest: test_defining_direct_inside_a_scope_raises_runtime_error
304
444
  ------------------------------------------------------------------------------
305
-  (0.1ms) rollback transaction
306
-  (0.1ms) begin transaction
445
+  (0.0ms) rollback transaction
446
+  (0.0ms) begin transaction
307
447
  ----------------------------------------------------------------------
308
448
  CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
309
449
  ----------------------------------------------------------------------
310
-  (0.1ms) rollback transaction
311
-  (0.7ms) begin transaction
450
+  (0.0ms) rollback transaction
451
+  (0.1ms) begin transaction
312
452
  ---------------------------------------
313
453
  CustomUrlHelpersTest: test_direct_paths
314
454
  ---------------------------------------
315
-  (0.1ms) rollback transaction
316
-  (0.1ms) begin transaction
455
+  (0.0ms) rollback transaction
456
+  (0.3ms) begin transaction
457
+ ------------------------------------------------------------------------------
458
+ CustomUrlHelpersTest: test_defining_direct_inside_a_scope_raises_runtime_error
459
+ ------------------------------------------------------------------------------
460
+  (0.0ms) rollback transaction
461
+  (0.3ms) begin transaction
317
462
  --------------------------------------
318
463
  CustomUrlHelpersTest: test_direct_urls
319
464
  --------------------------------------
320
-  (0.1ms) rollback transaction
465
+  (0.0ms) rollback transaction
466
+  (0.2ms) begin transaction
467
+ ----------------------------------------------------------------------
468
+ CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
469
+ ----------------------------------------------------------------------
470
+  (0.0ms) rollback transaction
321
471
   (0.1ms) begin transaction
322
472
  ------------------------------------------------------------------------------
323
473
  CustomUrlHelpersTest: test_defining_direct_inside_a_scope_raises_runtime_error
324
474
  ------------------------------------------------------------------------------
475
+  (0.0ms) rollback transaction
476
+  (0.0ms) begin transaction
477
+ ---------------------------------------
478
+ CustomUrlHelpersTest: test_direct_paths
479
+ ---------------------------------------
325
480
   (0.1ms) rollback transaction
326
481
   (0.1ms) begin transaction
482
+ ----------------------------------------------------------------------
483
+ CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
484
+ ----------------------------------------------------------------------
485
+  (0.1ms) rollback transaction
486
+  (0.0ms) begin transaction
327
487
  --------------------------------------
328
488
  CustomUrlHelpersTest: test_direct_urls
329
489
  --------------------------------------
330
-  (0.1ms) rollback transaction
490
+  (0.0ms) rollback transaction
331
491
   (0.1ms) begin transaction
332
492
  ----------------------------------------------------------------------
333
493
  CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
334
494
  ----------------------------------------------------------------------
335
-  (0.1ms) rollback transaction
336
-  (0.1ms) begin transaction
495
+  (0.0ms) rollback transaction
496
+  (0.0ms) begin transaction
497
+ ------------------------------------------------------------------------------
498
+ CustomUrlHelpersTest: test_defining_direct_inside_a_scope_raises_runtime_error
499
+ ------------------------------------------------------------------------------
500
+  (0.0ms) rollback transaction
501
+  (0.0ms) begin transaction
337
502
  ---------------------------------------
338
503
  CustomUrlHelpersTest: test_direct_paths
339
504
  ---------------------------------------
@@ -343,18 +508,23 @@ CustomUrlHelpersTest: test_direct_paths
343
508
  CustomUrlHelpersTest: test_direct_urls
344
509
  --------------------------------------
345
510
   (0.1ms) rollback transaction
346
-  (0.0ms) begin transaction
347
- ----------------------------------------------------------------------
348
- CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
349
- ----------------------------------------------------------------------
350
-  (0.1ms) rollback transaction
351
-  (0.1ms) begin transaction
511
+  (0.1ms) begin transaction
352
512
  ---------------------------------------
353
513
  CustomUrlHelpersTest: test_direct_paths
354
514
  ---------------------------------------
355
-  (0.1ms) rollback transaction
356
-  (0.0ms) begin transaction
515
+  (0.1ms) rollback transaction
516
+  (0.0ms) begin transaction
357
517
  ------------------------------------------------------------------------------
358
518
  CustomUrlHelpersTest: test_defining_direct_inside_a_scope_raises_runtime_error
359
519
  ------------------------------------------------------------------------------
360
-  (0.1ms) rollback transaction
520
+  (0.0ms) rollback transaction
521
+  (0.0ms) begin transaction
522
+ ----------------------------------------------------------------------
523
+ CustomUrlHelpersTest: test_defining_direct_url_registers_helper_method
524
+ ----------------------------------------------------------------------
525
+  (0.0ms) rollback transaction
526
+  (0.1ms) begin transaction
527
+ --------------------------------------
528
+ CustomUrlHelpersTest: test_direct_urls
529
+ --------------------------------------
530
+  (0.0ms) rollback transaction
@@ -135,7 +135,7 @@ class CustomUrlHelpersTest < ActionDispatch::IntegrationTest
135
135
  @user = User.new
136
136
  @page = Page.new("6")
137
137
  @path_params = { "controller" => "pages", "action" => "index" }
138
- @unsafe_params = ActionController::Parameters.new(@path_param)
138
+ @unsafe_params = ActionController::Parameters.new(@path_params)
139
139
  @safe_params = ActionController::Parameters.new(@path_params).permit(:controller, :action)
140
140
  end
141
141
 
@@ -162,8 +162,14 @@ class CustomUrlHelpersTest < ActionDispatch::IntegrationTest
162
162
 
163
163
  assert_equal "/", params_path(@safe_params)
164
164
  assert_equal "/", Routes.url_helpers.params_path(@safe_params)
165
- assert_raises(ActionController::UrlGenerationError) { params_path(@unsafe_params) }
166
- assert_raises(ActionController::UrlGenerationError) { Routes.url_helpers.params_path(@unsafe_params) }
165
+
166
+ if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR == 2
167
+ assert_equal "/", params_path(@unsafe_params)
168
+ assert_equal "/", Routes.url_helpers.params_path(@unsafe_params)
169
+ elsif Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR == 0
170
+ assert_raises(ArgumentError) { params_path(@unsafe_params) }
171
+ assert_raises(ArgumentError) { Routes.url_helpers.params_path(@unsafe_params) }
172
+ end
167
173
 
168
174
  assert_equal "/basket", symbol_path
169
175
  assert_equal "/basket", Routes.url_helpers.symbol_path
@@ -202,8 +208,14 @@ class CustomUrlHelpersTest < ActionDispatch::IntegrationTest
202
208
 
203
209
  assert_equal "http://www.example.com/", params_url(@safe_params)
204
210
  assert_equal "http://www.example.com/", Routes.url_helpers.params_url(@safe_params)
205
- assert_raises(ActionController::UrlGenerationError) { params_url(@unsafe_params) }
206
- assert_raises(ActionController::UrlGenerationError) { Routes.url_helpers.params_url(@unsafe_params) }
211
+
212
+ if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR == 2
213
+ assert_equal "http://www.example.com/", params_url(@unsafe_params)
214
+ assert_equal "http://www.example.com/", Routes.url_helpers.params_url(@unsafe_params)
215
+ elsif Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR == 0
216
+ assert_raises(ArgumentError) { params_url(@unsafe_params) }
217
+ assert_raises(ArgumentError) { Routes.url_helpers.params_url(@unsafe_params) }
218
+ end
207
219
 
208
220
  assert_equal "http://www.example.com/basket", symbol_url
209
221
  assert_equal "http://www.example.com/basket", Routes.url_helpers.symbol_url
metadata CHANGED
@@ -1,71 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionpack-direct_routes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - hamuyuuki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-26 00:00:00.000000000 Z
11
+ date: 2019-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '4.2'
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: 4.2.0
22
+ version: '5.1'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '4.2'
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: 4.2.0
32
+ version: '5.1'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: activesupport
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - "~>"
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '4.2'
40
+ - - "<"
32
41
  - !ruby/object:Gem::Version
33
- version: 4.2.0
42
+ version: '5.1'
34
43
  type: :runtime
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
38
- - - "~>"
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '4.2'
50
+ - - "<"
39
51
  - !ruby/object:Gem::Version
40
- version: 4.2.0
52
+ version: '5.1'
41
53
  - !ruby/object:Gem::Dependency
42
- name: minitest
54
+ name: appraisal
43
55
  requirement: !ruby/object:Gem::Requirement
44
56
  requirements:
45
- - - "~>"
57
+ - - ">="
46
58
  - !ruby/object:Gem::Version
47
- version: 5.1.0
59
+ version: '0'
48
60
  type: :development
49
61
  prerelease: false
50
62
  version_requirements: !ruby/object:Gem::Requirement
51
63
  requirements:
52
- - - "~>"
64
+ - - ">="
53
65
  - !ruby/object:Gem::Version
54
- version: 5.1.0
66
+ version: '0'
55
67
  - !ruby/object:Gem::Dependency
56
- name: rails
68
+ name: minitest
57
69
  requirement: !ruby/object:Gem::Requirement
58
70
  requirements:
59
71
  - - "~>"
60
72
  - !ruby/object:Gem::Version
61
- version: 4.2.0
73
+ version: 5.1.0
62
74
  type: :development
63
75
  prerelease: false
64
76
  version_requirements: !ruby/object:Gem::Requirement
65
77
  requirements:
66
78
  - - "~>"
67
79
  - !ruby/object:Gem::Version
68
- version: 4.2.0
80
+ version: 5.1.0
69
81
  - !ruby/object:Gem::Dependency
70
82
  name: rubocop
71
83
  requirement: !ruby/object:Gem::Requirement
@@ -216,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
216
228
  version: '0'
217
229
  requirements: []
218
230
  rubyforge_project:
219
- rubygems_version: 2.6.14.1
231
+ rubygems_version: 2.6.14.4
220
232
  signing_key:
221
233
  specification_version: 4
222
234
  summary: Backport Direct routes into Rails 4 and Rails 5.0.