Skip to content
This repository

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

Merged
merged 1 commit into from over 2 years ago

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

Showing 1 unique commit by 1 author.

Feb 21, 2012
Toshinori Kajihara kennyj Support tilde and minus character. Fix Rails Issue #5114. faad3c8
This page is out of date. Refresh to see the latest.
2  lib/journey/scanner.rb
@@ -47,7 +47,7 @@ def scan
47 47 [:DOT, text]
48 48 when text = @ss.scan(/:\w+/)
49 49 [:SYMBOL, text]
50   - when text = @ss.scan(/[\w%-]+/)
  50 + when text = @ss.scan(/[\w%\-~]+/)
51 51 [:LITERAL, text]
52 52 # any char
53 53 when text = @ss.scan(/./)
2  test/route/definition/test_scanner.rb
@@ -13,6 +13,8 @@ def test_tokens
13 13 ['/', [[:SLASH, '/']]],
14 14 ['*omg', [[:STAR, '*'], [:LITERAL, 'omg']]],
15 15 ['/page', [[:SLASH, '/'], [:LITERAL, 'page']]],
  16 + ['/~page', [[:SLASH, '/'], [:LITERAL, '~page']]],
  17 + ['/pa-ge', [[:SLASH, '/'], [:LITERAL, 'pa-ge']]],
16 18 ['/:page', [[:SLASH, '/'], [:SYMBOL, ':page']]],
17 19 ['/(:page)', [
18 20 [:SLASH, '/'],

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.