Some time ago, I posted a doubt about the difference between (found in
action_view/paths.rb)
(Dir.glob("[EMAIL PROTECTED]/**/*/**") | Dir.glob("[EMAIL PROTECTED]/**"))
and
Dir.glob("[EMAIL PROTECTED]/**/*")
No one answered me here neither in ruby-talk list. I've found the
differences a few days when trying to submit a patch. I'm new to git
and I thought that the test errors already existed before my patch.
After I submit, I got a response one test has failed. Then I finally
understood what was the difference.
Ruby doesn't follow symlinks in Dir['**/*'] to avoid infinite loop,
although it is not documented in the official Ruby documentation.
Actually
(Dir.glob("[EMAIL PROTECTED]/**/*/**") | Dir.glob("[EMAIL PROTECTED]/**"))
is the same as
(Dir.glob("[EMAIL PROTECTED]/**/*/**") | Dir.glob("[EMAIL PROTECTED]/*")) #
removed the
last *
This support one level of symlinked directory.
This feature is not documented anywhere and someone could be surprised
her symlinked dir is not being searched by Rails.
All this begin when I was trying to understand the Rails action view
source code. So I think it should be clearer. I could send a patch
removing the extra "*" and adding a comment to explain what that does
so that another developer could avoid this headache.
But then, I realized that I don't really understand what is the
advantage of supporting one level of symlinked directory and why there
is a test to this. Could someone tell me why ActionView needs to
support one-level symlinked directories? And don't you think that
ActionView path documentation should state this limitation with
symlinked directories?
I'm willing to help on this, but I need to think what the core
developers think about this.
Rodrigo.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---