rack-mount 0.6.11 → 0.6.12
Sign up to get free protection for your applications and to get access to all the features.
data/lib/rack/mount/route_set.rb
CHANGED
@@ -326,7 +326,7 @@ module Rack::Mount
|
|
326
326
|
@routes.each_with_index do |route, index|
|
327
327
|
catch(:skip) do
|
328
328
|
k = keys.map { |key| block.call(key, index) }
|
329
|
-
Utils.
|
329
|
+
Utils.pop_trailing_blanks!(k)
|
330
330
|
k.map! { |key| key || /.*/ }
|
331
331
|
graph[*k] = route
|
332
332
|
end
|
data/lib/rack/mount/utils.rb
CHANGED
@@ -46,16 +46,17 @@ module Rack::Mount
|
|
46
46
|
|
47
47
|
# Removes trailing nils from array.
|
48
48
|
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
52
|
-
|
53
|
-
|
49
|
+
# pop_trailing_blanks!([1, 2, 3]) # => [1, 2, 3]
|
50
|
+
# pop_trailing_blanks!([1, 2, 3, nil, ""]) # => [1, 2, 3]
|
51
|
+
# pop_trailing_blanks!([nil]) # => []
|
52
|
+
# pop_trailing_blanks!([""]) # => []
|
53
|
+
def pop_trailing_blanks!(ary)
|
54
|
+
while ary.length > 0 && (ary.last.nil? || ary.last == '')
|
54
55
|
ary.pop
|
55
56
|
end
|
56
57
|
ary
|
57
58
|
end
|
58
|
-
module_function :
|
59
|
+
module_function :pop_trailing_blanks!
|
59
60
|
|
60
61
|
RESERVED_PCHAR = ':@&=+$,;%'
|
61
62
|
SAFE_PCHAR = "#{URI::REGEXP::PATTERN::UNRESERVED}#{RESERVED_PCHAR}"
|
data/lib/rack/mount/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-mount
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 12
|
10
|
+
version: 0.6.12
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Joshua Peek
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-08-
|
18
|
+
date: 2010-08-22 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|