This project is archived and is in readonly mode.

#1296 ✓wontfix
Rodrigo Rosenfeld Rosas

Simplify glob in paths.rb (actionpack) to get a cleaner code

Reported by Rodrigo Rosenfeld Rosas | October 30th, 2008 @ 10:13 AM | in 2.x

As far as I'm concerned,

(Dir.glob("#{@path}//*/") | Dir.glob("#{@path}/**"))

gives the same elements as

Dir.glob("#{@path}/*/")

, though the last code is much cleaner

Comments and changes to this ticket

  • DHH

    DHH October 30th, 2008 @ 10:28 AM

    • Assigned user changed from “DHH” to “josh”
  • josh

    josh October 30th, 2008 @ 08:34 PM

    • State changed from “new” to “wontfix”

    Sadly it breaks symlinked directories. This test "test_symlinked_layout_is_rendered" fails after applying.

  • Rodrigo Rosenfeld Rosas

    Rodrigo Rosenfeld Rosas November 6th, 2008 @ 07:43 PM

    Please, note that no one answered to http://groups.google.com/group/r...

    nor

    http://groups.google.com/group/r...

    I guess no one relies on symlinked dir. If you agree, I'd like to submit you a patch that removes the one level symlinked dir test (and support, of course) to make Rails a bit faster and with a much cleaner code.

    If you don't agree, I would like at least to submit a new patch for documenting the reason that code is written that way (for supporting one level of symlinked dir) and for stating Rails limitation with symlinked dirs on documentation.

    Please, let me know what you think about this?

  • josh

    josh November 6th, 2008 @ 09:04 PM

    I think symlinked directories are sometimes used with plugins. Although, in that case they should probably just added their plugin to the view path. I do think its a legitimate use though.

    BTW, it is not slowing Rails down because this only happens once at boot.

    I'm still somewhat interested in deprecating it, but it would have to be done after 2.2 anyway.

  • Rodrigo Rosenfeld Rosas

    Rodrigo Rosenfeld Rosas November 7th, 2008 @ 11:14 AM

    It would be a good thing to deprecate and I don't need it to be deprecated before 2.2. My major concern is about it not been documented neither the code nor the symlinked dir limitations.

    Do you mind if I send you a patch for documenting that code and writing this limitation on Rails doc? If not, how could you deprecate something that not even is documented?

    Should I include the deprecate already in the patch? Is there any instructions of how it should be done? Just writing about this deprecate usage in the documentation should be enough? Or should I check for symlinked dir on boot loading and display a message if a symlinked dir is found?

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

Pages