Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Merged
merged 1 commit into from

2 participants

Toshinori Kajihara Aaron Patterson
Toshinori Kajihara

Please see rails/rails#5114.

I think that this PR also should merge to 1-0-stable.

Aaron Patterson tenderlove merged commit 1949664 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 21, 2012
  1. Toshinori Kajihara
This page is out of date. Refresh to see the latest.
2  lib/journey/scanner.rb
View
@@ -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(/./)
2  test/route/definition/test_scanner.rb
View
@@ -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, '/'],
Something went wrong with that request. Please try again.