rack-slashenforce 0.0.1 → 0.0.2
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.md +5 -2
- data/lib/rack-slashenforce.rb +3 -3
- metadata +3 -3
data/README.md
CHANGED
@@ -18,15 +18,18 @@ gem 'rack-slashenforce', :require => 'rack'
|
|
18
18
|
Add one of the following to config.ru:
|
19
19
|
|
20
20
|
To enforce a trailing slash on all urls without a period in them:
|
21
|
+
|
21
22
|
```ruby
|
22
23
|
use Rack::AppendSlash
|
23
24
|
```
|
24
25
|
|
25
26
|
To enforce no trailing slashes on any urls:
|
27
|
+
|
26
28
|
```ruby
|
27
29
|
use Rack::RemoveSlash
|
28
30
|
```
|
29
31
|
|
30
|
-
For a more robust solution, see
|
32
|
+
For a more robust solution, see [rack-rewrite](https://github.com/jtrupiano/rack-rewrite).
|
33
|
+
|
31
34
|
|
32
|
-
Copyright (c) 2012 Tyler Kellen. See LICENSE for further details.
|
35
|
+
> Copyright (c) 2012 Tyler Kellen. See LICENSE for further details.
|
data/lib/rack-slashenforce.rb
CHANGED
@@ -2,11 +2,11 @@ module Rack
|
|
2
2
|
|
3
3
|
module SlashEnforce
|
4
4
|
def self.version
|
5
|
-
'0.0.
|
5
|
+
'0.0.2'
|
6
6
|
end
|
7
7
|
end
|
8
8
|
|
9
|
-
class
|
9
|
+
class RemoveTrailingSlashes
|
10
10
|
# regexp to match strings that start and end with a slash
|
11
11
|
MATCH = %r{^/(.*)/$}
|
12
12
|
|
@@ -24,7 +24,7 @@ module Rack
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
class
|
27
|
+
class AppendTrailingSlash
|
28
28
|
# regexp to match strings without periods that start and end with a slash
|
29
29
|
MATCH = %r{^/([^.]*)[^/]$}
|
30
30
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-slashenforce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-03-10 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
16
|
-
requirement: &
|
16
|
+
requirement: &70352000862100 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70352000862100
|
25
25
|
description: ''
|
26
26
|
email: tyler@sleekcode.net
|
27
27
|
executables: []
|