Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

AUTOLINK_RE ruby 1.9 compatibility fix

#783

ruby 1.9 complains about some regexp being too complex:


activesupport/lib/active_support/dependencies.rb:510: warning: nested repeat operator + and ? was replaced with '*'

not very helpful, eh?

after tracing the requires I simplified


(?:/(?:(?:[~\w\+@%=\(\)-]|(?:[,.;:'][^\s$]))+)?)* # path

to


(?:/(?:[~\w\+@%=\(\)-]|(?:[,.;:'][^\s$]))*)* # path

this stops the warning, and should be equivalent (I think so and there no test failures).

Reported by Stefan Kaes · August 8th, 2008 @ 10:23 AM

State: resolved
Milestone: 2.x
Assigned to: josh josh
Importance: none

Activity

  1. Stefan Kaes
  2. josh
    josh
    • Assigned user set to josh

    August 9th, 2008 @ 06:40 AM

  3. josh
    josh

    I thought I fixed this twice.

    August 9th, 2008 @ 04:36 PM

  4. Stefan Kaes
    Stefan Kaes

    so? the first regexp can be transformed into the second, is simpler, semantically equivalent and stops the warning. why not apply the fix?

    August 9th, 2008 @ 04:40 PM

  5. Stefan Kaes
    Stefan Kaes

    I mean, the second is simpler, of course

    August 9th, 2008 @ 04:48 PM

  6. Repository
    Repository
    • State changed from new to resolved

    (from [b2630502a0525e5965d4eff283e3d2613cd1ca19]) Fixed autolink regexp compatibility for ruby 1.9 [#783 AUTOLINK_RE ruby 1.9 compatibility fix state:resolved] Signed-off-by: Joshua Peek josh@joshpeek.com http://github.com/rails/rails/co...

    August 9th, 2008 @ 04:49 PM