This project is archived and is in readonly mode.
Problems with POSIX character classes as routing constraints
Reported by Florian Aßmann | August 31st, 2010 @ 09:59 AM | in 3.0.2
In an Ruby on Rails 3 app before RoR 3 development has got its own stable branch I used a constraint with POSIX character classes. But since then it was broken.
The defined scope and its routes:
scope 'o~', :token => /[[:alnum:]]{40}/ do
get ':token' => 'token#show', :as => :token
# ...
end
In Terminal I do:
$ rake routes
(in /Users/florian/Development/takeda)
rake aborted!
premature end of char-class: /\A[[:alnum:]\Z/
Comments and changes to this ticket
-
Andrew White August 31st, 2010 @ 11:38 AM
- Milestone cleared.
- State changed from new to open
- Assigned user set to josh
- Importance changed from to Low
You're missing a do after the regexp. After I add the do then rake routes runs fine but I do get an error in route generation and recognition. It looks as though the error is in the Regin regexp analyser - it appears to be removing the closing square bracket from the character class.
-
Andrew White August 31st, 2010 @ 12:36 PM
Yup, the Regin parser doesn't handle the named character class:
>> Regin.parse(/\A[[:alnum:]]{40}\Z/).to_a => [#<Anchor "\\A">, #<CharacterClass "[[:alnum:]">, #<Character "]{40}">, #<Anchor "\\Z">]
-
Andrew White August 31st, 2010 @ 04:26 PM
Florian, can you gem install -v=0.6.13 'rack-mount' and see if that fixes your problem - it does for me.
-
Andrew White August 31st, 2010 @ 05:45 PM
- Assigned user changed from josh to José Valim
Patch to bump rack-mount to 0.6.13 and add test case to catch any regressions.
-
Repository September 1st, 2010 @ 01:17 AM
- State changed from open to resolved
(from [6c3f5eb76c2277e8a8e94d8c7d8942dc2d11a3df]) Bump rack-mount to 0.6.13 and add test case for named character classes [#5509 state:resolved]
Signed-off-by: Santiago Pastorino santiago@wyeworks.com
http://github.com/rails/rails/commit/6c3f5eb76c2277e8a8e94d8c7d8942... -
Repository September 1st, 2010 @ 01:29 AM
(from [69ae216bcf9fd8b7ba4f69681a410b9e1e7541ca]) Bump rack-mount to 0.6.13 and add test case for named character classes [#5509 state:resolved]
Signed-off-by: Santiago Pastorino santiago@wyeworks.com
http://github.com/rails/rails/commit/69ae216bcf9fd8b7ba4f69681a410b...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 5509 Problems with POSIX character classes as routing constraints (from [6c3f5eb76c2277e8a8e94d8c7d8942dc2d11a3df]) Bump ra...
- 5509 Problems with POSIX character classes as routing constraints (from [69ae216bcf9fd8b7ba4f69681a410b9e1e7541ca]) Bump ra...