slug-engine 0.0.3 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +22 -3
- data/app/rack/dispatcher.rb +64 -0
- data/config/routes.rb +2 -2
- data/lib/slug.rb +0 -1
- data/lib/slug/engine.rb +0 -3
- data/lib/slug/version.rb +1 -1
- data/test/dummy/app/controllers/posts_controller.rb +6 -4
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/log/development.log +7605 -0
- data/test/dummy/tmp/cache/assets/C06/A00/sprockets%2Fe8698635e3a42938c23078559237f054 +0 -0
- data/test/dummy/tmp/cache/assets/C31/1C0/sprockets%2F782bb3033328116a00928cf121c48a01 +0 -0
- data/test/dummy/tmp/cache/assets/C83/E40/sprockets%2Fdb6878130b1939c0726e4829b1e0b088 +0 -0
- data/test/dummy/tmp/cache/assets/C8C/0B0/sprockets%2F619537e97de31591f189aaf1035b3495 +0 -0
- data/test/dummy/tmp/cache/assets/C8C/B80/sprockets%2F371bf96e99717688ed7313a0c53f4212 +0 -0
- data/test/dummy/tmp/cache/assets/CAA/620/sprockets%2F87b209c0c9da28094a8d5581a21262c6 +0 -0
- data/test/dummy/tmp/cache/assets/CC7/220/sprockets%2Fd066c004d1fd26ae76a61303a7a18145 +0 -0
- data/test/dummy/tmp/cache/assets/CD5/B70/sprockets%2F416150dc3ac35079c94273cc46e90aa6 +0 -0
- data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/CD8/B70/sprockets%2F4050a4e5062ab95c9f32e9b6940821ea +0 -0
- data/test/dummy/tmp/cache/assets/CDF/070/sprockets%2F70e3c8a3916622c17858d520dcee0d92 +0 -0
- data/test/dummy/tmp/cache/assets/CF0/1D0/sprockets%2F6fc757c2c8329244ca95d6909865bbc2 +0 -0
- data/test/dummy/tmp/cache/assets/D04/CD0/sprockets%2F31507dbccf7cba1b7324d2e065776561 +0 -0
- data/test/dummy/tmp/cache/assets/D11/D20/sprockets%2Fcac21eac42152981882bf9e489316af4 +0 -0
- data/test/dummy/tmp/cache/assets/D1A/310/sprockets%2F5384ad85f52d3272dbc64d46ef3876a4 +0 -0
- data/test/dummy/tmp/cache/assets/D2E/110/sprockets%2F1f206deeb0e375c46aeb1c261781b254 +0 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D46/650/sprockets%2Ff56253b5f374fff1a33fbbc9881c9124 +0 -0
- data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4 +0 -0
- data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/D67/B60/sprockets%2F5f1a0d05e77ca8b9a1fc2a47e17a8174 +0 -0
- data/test/dummy/tmp/cache/assets/D73/220/sprockets%2F3dbc0a37f98fb43ec819b85a64d32c55 +0 -0
- data/test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +2 -2
- data/test/dummy/tmp/cache/assets/D8C/530/sprockets%2Fcdcbe0310d6fd0720e61f751bb655ad6 +0 -0
- data/test/dummy/tmp/cache/assets/D90/A60/sprockets%2Fd66c840cd4aecd0a19194e3170df4a2c +0 -0
- data/test/dummy/tmp/cache/assets/D94/980/sprockets%2F2373f211d11e64dbff45ce4d5e6da3f1 +0 -0
- data/test/dummy/tmp/cache/assets/D9C/CD0/sprockets%2Fc85016e7bbd4f3adbb7635d01f85d39b +0 -0
- data/test/dummy/tmp/cache/assets/DA9/510/sprockets%2F44a53ee4e5c28bf64993d4b7bfda1a79 +0 -0
- data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/E05/500/sprockets%2F98aed5b7ad9b7baab0e86b438a6438ed +0 -0
- data/test/dummy/tmp/cache/assets/E06/920/sprockets%2F6baa37d1c26468aef4fe5fe4bf982fa3 +0 -0
- data/test/dummy/tmp/cache/assets/E46/640/sprockets%2Fd327c0df3d6aebfc1fd0ac5ca5c05e14 +0 -0
- data/test/dummy/tmp/cache/assets/E7C/9B0/sprockets%2Ffbaf5adc86d5bacaa09e479bb0b6b13a +0 -0
- metadata +54 -14
- data/app/controllers/permalinks_controller.rb +0 -45
- data/app/helpers/permalinks_helper.rb +0 -2
- data/lib/slug/filter.rb +0 -33
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
o: ActiveSupport::Cache::Entry :@compressedF:@value{ "
|
|
1
|
+
o: ActiveSupport::Cache::Entry :@compressedF:@value{ "
|
|
2
2
|
* jQuery JavaScript Library v1.6.4
|
|
3
3
|
* http://jquery.com/
|
|
4
4
|
*
|
|
@@ -9426,4 +9426,4 @@ window.jQuery = window.$ = jQuery;
|
|
|
9426
9426
|
// the compiled file.
|
|
9427
9427
|
//
|
|
9428
9428
|
;
|
|
9429
|
-
:@created_atf
|
|
9429
|
+
:@created_atf1338129525.937351��:@expires_in0
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: slug-engine
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 27
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
|
+
- 1
|
|
8
9
|
- 0
|
|
9
|
-
|
|
10
|
-
version: 0.0.3
|
|
10
|
+
version: 0.1.0
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Jarrod Carlson
|
|
@@ -15,14 +15,15 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date:
|
|
18
|
+
date: 2012-05-27 00:00:00 Z
|
|
19
19
|
dependencies:
|
|
20
20
|
- !ruby/object:Gem::Dependency
|
|
21
|
-
|
|
21
|
+
name: rails
|
|
22
|
+
prerelease: false
|
|
22
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
|
23
24
|
none: false
|
|
24
25
|
requirements:
|
|
25
|
-
- -
|
|
26
|
+
- - ">="
|
|
26
27
|
- !ruby/object:Gem::Version
|
|
27
28
|
hash: 1
|
|
28
29
|
segments:
|
|
@@ -30,11 +31,11 @@ dependencies:
|
|
|
30
31
|
- 1
|
|
31
32
|
- 1
|
|
32
33
|
version: 3.1.1
|
|
34
|
+
type: :runtime
|
|
33
35
|
version_requirements: *id001
|
|
34
|
-
prerelease: false
|
|
35
|
-
name: rails
|
|
36
36
|
- !ruby/object:Gem::Dependency
|
|
37
|
-
|
|
37
|
+
name: sqlite3
|
|
38
|
+
prerelease: false
|
|
38
39
|
requirement: &id002 !ruby/object:Gem::Requirement
|
|
39
40
|
none: false
|
|
40
41
|
requirements:
|
|
@@ -44,9 +45,8 @@ dependencies:
|
|
|
44
45
|
segments:
|
|
45
46
|
- 0
|
|
46
47
|
version: "0"
|
|
48
|
+
type: :development
|
|
47
49
|
version_requirements: *id002
|
|
48
|
-
prerelease: false
|
|
49
|
-
name: sqlite3
|
|
50
50
|
description: Rails Engine for permalinks
|
|
51
51
|
email:
|
|
52
52
|
- jarrod.carlson@gmail.com
|
|
@@ -57,14 +57,12 @@ extensions: []
|
|
|
57
57
|
extra_rdoc_files: []
|
|
58
58
|
|
|
59
59
|
files:
|
|
60
|
-
- app/controllers/permalinks_controller.rb
|
|
61
|
-
- app/helpers/permalinks_helper.rb
|
|
62
60
|
- app/helpers/slug_helper.rb
|
|
63
61
|
- app/models/permalink.rb
|
|
62
|
+
- app/rack/dispatcher.rb
|
|
64
63
|
- config/routes.rb
|
|
65
64
|
- db/migrate/20111108194929_create_permalinks.rb
|
|
66
65
|
- lib/slug/engine.rb
|
|
67
|
-
- lib/slug/filter.rb
|
|
68
66
|
- lib/slug/version.rb
|
|
69
67
|
- lib/slug-engine.rb
|
|
70
68
|
- lib/slug.rb
|
|
@@ -136,35 +134,56 @@ files:
|
|
|
136
134
|
- test/dummy/test/unit/post_test.rb
|
|
137
135
|
- test/dummy/test/unit/user_test.rb
|
|
138
136
|
- test/dummy/tmp/cache/assets/C06/A00/sprockets%2Fe8698635e3a42938c23078559237f054
|
|
137
|
+
- test/dummy/tmp/cache/assets/C31/1C0/sprockets%2F782bb3033328116a00928cf121c48a01
|
|
138
|
+
- test/dummy/tmp/cache/assets/C83/E40/sprockets%2Fdb6878130b1939c0726e4829b1e0b088
|
|
139
|
+
- test/dummy/tmp/cache/assets/C8C/0B0/sprockets%2F619537e97de31591f189aaf1035b3495
|
|
140
|
+
- test/dummy/tmp/cache/assets/C8C/B80/sprockets%2F371bf96e99717688ed7313a0c53f4212
|
|
139
141
|
- test/dummy/tmp/cache/assets/CAA/620/sprockets%2F87b209c0c9da28094a8d5581a21262c6
|
|
140
142
|
- test/dummy/tmp/cache/assets/CAA/C50/sprockets%2F3173be70d508b937064ce74b7363d13b
|
|
143
|
+
- test/dummy/tmp/cache/assets/CC7/220/sprockets%2Fd066c004d1fd26ae76a61303a7a18145
|
|
141
144
|
- test/dummy/tmp/cache/assets/CC7/5F0/sprockets%2F8bf37168fb70e08b9e4578e72739a543
|
|
145
|
+
- test/dummy/tmp/cache/assets/CD5/B70/sprockets%2F416150dc3ac35079c94273cc46e90aa6
|
|
146
|
+
- test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
|
|
147
|
+
- test/dummy/tmp/cache/assets/CD8/B70/sprockets%2F4050a4e5062ab95c9f32e9b6940821ea
|
|
142
148
|
- test/dummy/tmp/cache/assets/CDA/250/sprockets%2F9f6ba51c401a4b1885146d692f56dd20
|
|
143
149
|
- test/dummy/tmp/cache/assets/CDF/070/sprockets%2F70e3c8a3916622c17858d520dcee0d92
|
|
144
150
|
- test/dummy/tmp/cache/assets/CF0/1D0/sprockets%2F6fc757c2c8329244ca95d6909865bbc2
|
|
145
151
|
- test/dummy/tmp/cache/assets/D03/AF0/sprockets%2F79009b48c13f7b213134c8ac51caf65b
|
|
152
|
+
- test/dummy/tmp/cache/assets/D04/CD0/sprockets%2F31507dbccf7cba1b7324d2e065776561
|
|
146
153
|
- test/dummy/tmp/cache/assets/D11/D20/sprockets%2Fcac21eac42152981882bf9e489316af4
|
|
147
154
|
- test/dummy/tmp/cache/assets/D1A/310/sprockets%2F5384ad85f52d3272dbc64d46ef3876a4
|
|
148
155
|
- test/dummy/tmp/cache/assets/D23/E70/sprockets%2F8de174e8fa8a6828ee7fa348335900f4
|
|
149
156
|
- test/dummy/tmp/cache/assets/D2E/090/sprockets%2Fc54283e81ce52bf9d542ab12492a01ad
|
|
157
|
+
- test/dummy/tmp/cache/assets/D2E/110/sprockets%2F1f206deeb0e375c46aeb1c261781b254
|
|
150
158
|
- test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
|
|
151
159
|
- test/dummy/tmp/cache/assets/D36/030/sprockets%2F63bdbca18172eaab4b20628e4399d663
|
|
152
160
|
- test/dummy/tmp/cache/assets/D3E/B20/sprockets%2F1f79ee84bd6d74d100c5cb018b662b67
|
|
153
161
|
- test/dummy/tmp/cache/assets/D46/650/sprockets%2Ff56253b5f374fff1a33fbbc9881c9124
|
|
162
|
+
- test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655
|
|
154
163
|
- test/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4
|
|
164
|
+
- test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6
|
|
165
|
+
- test/dummy/tmp/cache/assets/D67/B60/sprockets%2F5f1a0d05e77ca8b9a1fc2a47e17a8174
|
|
155
166
|
- test/dummy/tmp/cache/assets/D6C/450/sprockets%2Fb5a9c753f78c4fb270358b5b3d0ddb24
|
|
156
167
|
- test/dummy/tmp/cache/assets/D73/220/sprockets%2F3dbc0a37f98fb43ec819b85a64d32c55
|
|
157
168
|
- test/dummy/tmp/cache/assets/D74/690/sprockets%2F8ce828da6803d77571ba4bd2ce297b4b
|
|
158
169
|
- test/dummy/tmp/cache/assets/D7A/370/sprockets%2Fea1283f2c7d533c8f65de7e03f7f92d3
|
|
159
170
|
- test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384
|
|
171
|
+
- test/dummy/tmp/cache/assets/D8C/530/sprockets%2Fcdcbe0310d6fd0720e61f751bb655ad6
|
|
172
|
+
- test/dummy/tmp/cache/assets/D90/A60/sprockets%2Fd66c840cd4aecd0a19194e3170df4a2c
|
|
173
|
+
- test/dummy/tmp/cache/assets/D94/980/sprockets%2F2373f211d11e64dbff45ce4d5e6da3f1
|
|
160
174
|
- test/dummy/tmp/cache/assets/D9B/9C0/sprockets%2F4e197c078b17aea1ec1df9746ddf2a30
|
|
161
175
|
- test/dummy/tmp/cache/assets/D9C/CD0/sprockets%2Fc85016e7bbd4f3adbb7635d01f85d39b
|
|
162
176
|
- test/dummy/tmp/cache/assets/DA1/4A0/sprockets%2Fb398851b563c62cf3bf4cbbad8c57d25
|
|
177
|
+
- test/dummy/tmp/cache/assets/DA9/510/sprockets%2F44a53ee4e5c28bf64993d4b7bfda1a79
|
|
163
178
|
- test/dummy/tmp/cache/assets/DBA/AB0/sprockets%2F8be4208fd77cb5ef9b6f77e5fcf18670
|
|
164
179
|
- test/dummy/tmp/cache/assets/DC0/870/sprockets%2F289d3a70441ad26d24edcd25fd0dca6c
|
|
180
|
+
- test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994
|
|
165
181
|
- test/dummy/tmp/cache/assets/E03/E80/sprockets%2F4a6c93824e15c2d5fdfbbbf7cfdc3646
|
|
166
182
|
- test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
|
|
183
|
+
- test/dummy/tmp/cache/assets/E05/500/sprockets%2F98aed5b7ad9b7baab0e86b438a6438ed
|
|
167
184
|
- test/dummy/tmp/cache/assets/E06/920/sprockets%2F6baa37d1c26468aef4fe5fe4bf982fa3
|
|
185
|
+
- test/dummy/tmp/cache/assets/E46/640/sprockets%2Fd327c0df3d6aebfc1fd0ac5ca5c05e14
|
|
186
|
+
- test/dummy/tmp/cache/assets/E7C/9B0/sprockets%2Ffbaf5adc86d5bacaa09e479bb0b6b13a
|
|
168
187
|
- test/slug_test.rb
|
|
169
188
|
- test/test_helper.rb
|
|
170
189
|
homepage: https://github.com/jcarlson/slug-engine
|
|
@@ -265,34 +284,55 @@ test_files:
|
|
|
265
284
|
- test/dummy/test/unit/post_test.rb
|
|
266
285
|
- test/dummy/test/unit/user_test.rb
|
|
267
286
|
- test/dummy/tmp/cache/assets/C06/A00/sprockets%2Fe8698635e3a42938c23078559237f054
|
|
287
|
+
- test/dummy/tmp/cache/assets/C31/1C0/sprockets%2F782bb3033328116a00928cf121c48a01
|
|
288
|
+
- test/dummy/tmp/cache/assets/C83/E40/sprockets%2Fdb6878130b1939c0726e4829b1e0b088
|
|
289
|
+
- test/dummy/tmp/cache/assets/C8C/0B0/sprockets%2F619537e97de31591f189aaf1035b3495
|
|
290
|
+
- test/dummy/tmp/cache/assets/C8C/B80/sprockets%2F371bf96e99717688ed7313a0c53f4212
|
|
268
291
|
- test/dummy/tmp/cache/assets/CAA/620/sprockets%2F87b209c0c9da28094a8d5581a21262c6
|
|
269
292
|
- test/dummy/tmp/cache/assets/CAA/C50/sprockets%2F3173be70d508b937064ce74b7363d13b
|
|
293
|
+
- test/dummy/tmp/cache/assets/CC7/220/sprockets%2Fd066c004d1fd26ae76a61303a7a18145
|
|
270
294
|
- test/dummy/tmp/cache/assets/CC7/5F0/sprockets%2F8bf37168fb70e08b9e4578e72739a543
|
|
295
|
+
- test/dummy/tmp/cache/assets/CD5/B70/sprockets%2F416150dc3ac35079c94273cc46e90aa6
|
|
296
|
+
- test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
|
|
297
|
+
- test/dummy/tmp/cache/assets/CD8/B70/sprockets%2F4050a4e5062ab95c9f32e9b6940821ea
|
|
271
298
|
- test/dummy/tmp/cache/assets/CDA/250/sprockets%2F9f6ba51c401a4b1885146d692f56dd20
|
|
272
299
|
- test/dummy/tmp/cache/assets/CDF/070/sprockets%2F70e3c8a3916622c17858d520dcee0d92
|
|
273
300
|
- test/dummy/tmp/cache/assets/CF0/1D0/sprockets%2F6fc757c2c8329244ca95d6909865bbc2
|
|
274
301
|
- test/dummy/tmp/cache/assets/D03/AF0/sprockets%2F79009b48c13f7b213134c8ac51caf65b
|
|
302
|
+
- test/dummy/tmp/cache/assets/D04/CD0/sprockets%2F31507dbccf7cba1b7324d2e065776561
|
|
275
303
|
- test/dummy/tmp/cache/assets/D11/D20/sprockets%2Fcac21eac42152981882bf9e489316af4
|
|
276
304
|
- test/dummy/tmp/cache/assets/D1A/310/sprockets%2F5384ad85f52d3272dbc64d46ef3876a4
|
|
277
305
|
- test/dummy/tmp/cache/assets/D23/E70/sprockets%2F8de174e8fa8a6828ee7fa348335900f4
|
|
278
306
|
- test/dummy/tmp/cache/assets/D2E/090/sprockets%2Fc54283e81ce52bf9d542ab12492a01ad
|
|
307
|
+
- test/dummy/tmp/cache/assets/D2E/110/sprockets%2F1f206deeb0e375c46aeb1c261781b254
|
|
279
308
|
- test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
|
|
280
309
|
- test/dummy/tmp/cache/assets/D36/030/sprockets%2F63bdbca18172eaab4b20628e4399d663
|
|
281
310
|
- test/dummy/tmp/cache/assets/D3E/B20/sprockets%2F1f79ee84bd6d74d100c5cb018b662b67
|
|
282
311
|
- test/dummy/tmp/cache/assets/D46/650/sprockets%2Ff56253b5f374fff1a33fbbc9881c9124
|
|
312
|
+
- test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655
|
|
283
313
|
- test/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4
|
|
314
|
+
- test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6
|
|
315
|
+
- test/dummy/tmp/cache/assets/D67/B60/sprockets%2F5f1a0d05e77ca8b9a1fc2a47e17a8174
|
|
284
316
|
- test/dummy/tmp/cache/assets/D6C/450/sprockets%2Fb5a9c753f78c4fb270358b5b3d0ddb24
|
|
285
317
|
- test/dummy/tmp/cache/assets/D73/220/sprockets%2F3dbc0a37f98fb43ec819b85a64d32c55
|
|
286
318
|
- test/dummy/tmp/cache/assets/D74/690/sprockets%2F8ce828da6803d77571ba4bd2ce297b4b
|
|
287
319
|
- test/dummy/tmp/cache/assets/D7A/370/sprockets%2Fea1283f2c7d533c8f65de7e03f7f92d3
|
|
288
320
|
- test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384
|
|
321
|
+
- test/dummy/tmp/cache/assets/D8C/530/sprockets%2Fcdcbe0310d6fd0720e61f751bb655ad6
|
|
322
|
+
- test/dummy/tmp/cache/assets/D90/A60/sprockets%2Fd66c840cd4aecd0a19194e3170df4a2c
|
|
323
|
+
- test/dummy/tmp/cache/assets/D94/980/sprockets%2F2373f211d11e64dbff45ce4d5e6da3f1
|
|
289
324
|
- test/dummy/tmp/cache/assets/D9B/9C0/sprockets%2F4e197c078b17aea1ec1df9746ddf2a30
|
|
290
325
|
- test/dummy/tmp/cache/assets/D9C/CD0/sprockets%2Fc85016e7bbd4f3adbb7635d01f85d39b
|
|
291
326
|
- test/dummy/tmp/cache/assets/DA1/4A0/sprockets%2Fb398851b563c62cf3bf4cbbad8c57d25
|
|
327
|
+
- test/dummy/tmp/cache/assets/DA9/510/sprockets%2F44a53ee4e5c28bf64993d4b7bfda1a79
|
|
292
328
|
- test/dummy/tmp/cache/assets/DBA/AB0/sprockets%2F8be4208fd77cb5ef9b6f77e5fcf18670
|
|
293
329
|
- test/dummy/tmp/cache/assets/DC0/870/sprockets%2F289d3a70441ad26d24edcd25fd0dca6c
|
|
330
|
+
- test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994
|
|
294
331
|
- test/dummy/tmp/cache/assets/E03/E80/sprockets%2F4a6c93824e15c2d5fdfbbbf7cfdc3646
|
|
295
332
|
- test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
|
|
333
|
+
- test/dummy/tmp/cache/assets/E05/500/sprockets%2F98aed5b7ad9b7baab0e86b438a6438ed
|
|
296
334
|
- test/dummy/tmp/cache/assets/E06/920/sprockets%2F6baa37d1c26468aef4fe5fe4bf982fa3
|
|
335
|
+
- test/dummy/tmp/cache/assets/E46/640/sprockets%2Fd327c0df3d6aebfc1fd0ac5ca5c05e14
|
|
336
|
+
- test/dummy/tmp/cache/assets/E7C/9B0/sprockets%2Ffbaf5adc86d5bacaa09e479bb0b6b13a
|
|
297
337
|
- test/slug_test.rb
|
|
298
338
|
- test/test_helper.rb
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
class PermalinksController < ApplicationController
|
|
2
|
-
|
|
3
|
-
# TODO: Need to figure out how to handle slugs with extensions, e.g., 'foo/bar/baz.jpg'
|
|
4
|
-
def show
|
|
5
|
-
# find permalink, raising error if none found
|
|
6
|
-
@permalink = Permalink.find_by_slug!(params[:slug])
|
|
7
|
-
|
|
8
|
-
# find content by permalink, raising error if none found
|
|
9
|
-
@content = content_class.find_by_permalink!(@permalink)
|
|
10
|
-
@content_type = @permalink.content_type
|
|
11
|
-
|
|
12
|
-
# customize view path based on content_type
|
|
13
|
-
prepend_view_path "app/views/#{@content_type.pluralize.underscore}"
|
|
14
|
-
|
|
15
|
-
# set params[:controller] to match model of content
|
|
16
|
-
params[:controller] = @content_type.pluralize.underscore
|
|
17
|
-
|
|
18
|
-
# render the appropriate partial for this content, and do it in the layout
|
|
19
|
-
render :partial => partial, :object => decorate(@content), :layout => true
|
|
20
|
-
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
protected
|
|
24
|
-
|
|
25
|
-
def content_class
|
|
26
|
-
@permalink.content_type.constantize
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
# TODO: Make this an application-extension, not built-in
|
|
30
|
-
def decorate(content)
|
|
31
|
-
decorated = begin
|
|
32
|
-
Module.const_get("#{@content_type}Decorator").decorate(content)
|
|
33
|
-
rescue NameError
|
|
34
|
-
content
|
|
35
|
-
end
|
|
36
|
-
decorated
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def partial
|
|
40
|
-
# We're going to have to make a guess about this...
|
|
41
|
-
# TODO: Is there some way to still defer to the partial renderer to determine the partial to use?
|
|
42
|
-
"#{@content_type.downcase.pluralize}/#{@content_type.downcase}"
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
end
|
data/lib/slug/filter.rb
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
module Slug
|
|
2
|
-
|
|
3
|
-
# This middleware is necessary so that the engine can abstain from processing
|
|
4
|
-
# requests where no such slug exists. If this behavior were done in a
|
|
5
|
-
# controller, Rails would heavily mutate the request object and no additional
|
|
6
|
-
# controllers would have much luck processing the request. Specifically, the
|
|
7
|
-
# named parameters for the route are cached on the request, and downstream
|
|
8
|
-
# controllers would get the wrong params hash.
|
|
9
|
-
|
|
10
|
-
class Filter
|
|
11
|
-
|
|
12
|
-
def initialize(app)
|
|
13
|
-
@app = app
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def call(env)
|
|
17
|
-
# if a matching slug exists in the database, allow engine to process it
|
|
18
|
-
if Permalink.where('slug = ?', slug(env['PATH_INFO'])).exists?
|
|
19
|
-
# slug found, allow request to continue to controller
|
|
20
|
-
@app.call(env)
|
|
21
|
-
else
|
|
22
|
-
# no slug matched, abstain from handling request
|
|
23
|
-
[404, {"X-Cascade" => "pass"}, ["no such slug exists"]]
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
# Extract the :slug value from the raw request
|
|
28
|
-
def slug(path)
|
|
29
|
-
path.match(/^(?:\/)?([^.]+)(?:\..*)?/)[1]
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
end
|
|
33
|
-
end
|