Skip to content
This repository has been archived by the owner on Sep 13, 2017. It is now read-only.

Support tilde and minus character. Fix Rails Issue #5114. #19

Merged
merged 1 commit into from
Feb 22, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/journey/scanner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def scan
[:DOT, text]
when text = @ss.scan(/:\w+/)
[:SYMBOL, text]
when text = @ss.scan(/[\w%-]+/)
when text = @ss.scan(/[\w%\-~]+/)
[:LITERAL, text]
# any char
when text = @ss.scan(/./)
Expand Down
2 changes: 2 additions & 0 deletions test/route/definition/test_scanner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ def test_tokens
['/', [[:SLASH, '/']]],
['*omg', [[:STAR, '*'], [:LITERAL, 'omg']]],
['/page', [[:SLASH, '/'], [:LITERAL, 'page']]],
['/~page', [[:SLASH, '/'], [:LITERAL, '~page']]],
['/pa-ge', [[:SLASH, '/'], [:LITERAL, 'pa-ge']]],
['/:page', [[:SLASH, '/'], [:SYMBOL, ':page']]],
['/(:page)', [
[:SLASH, '/'],
Expand Down