Brandon Keepers
2006-Dec-08 23:47 UTC
ticket #4245 - Fix rake/generators for symlinked plugins
Ticket #4245 has a small patch [1] fixes custom rake tasks and generators for plugins that are symlinked. It changes Dir.glob from using /**/ (which doesn''t follow symlinks) to use /*/**/, which will follow one symlink without any adverse effects. I would appreciate it if someone would apply this patch since Rails partially works with symlinked plugins (it loads them), but the plugins generators and rake tasks won''t work. Thanks, Brandon [1] http://dev.rubyonrails.org/attachment/ticket/4245/ symlinked_plugins.patch --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
eclaymoore
2006-Dec-11 16:47 UTC
Re: ticket #4245 - Fix rake/generators for symlinked plugins
Brandon, I am a Rails user in practice and do not presume to know enough to touch the internal code, but I am concerned by your patch to allow for symlinked plugins. You are suggesting to change lines like this: sources << PathSource.new(:plugins, "#{::RAILS_ROOT}/vendor/plugins/**/generators") To this: sources << PathSource.new(:plugins, "#{::RAILS_ROOT}/vendor/plugins/*/**/generators") I could be wrong, but wouldn''t allowing for symlinks to plugins keep Windows users from accessing them? I have only seen symlinks used on deployed servers (i.e. Capistrano), but what you are suggesting would affect the windows developer environment directly. Can someone please chime in and confirm or debunk my concerns. Thank you, Eric M. Brandon Keepers wrote:> Ticket #4245 has a small patch [1] fixes custom rake tasks and > generators for plugins that are symlinked. It changes Dir.glob from > using /**/ (which doesn''t follow symlinks) to use /*/**/, which will > follow one symlink without any adverse effects. > > I would appreciate it if someone would apply this patch since Rails > partially works with symlinked plugins (it loads them), but the > plugins generators and rake tasks won''t work. > > Thanks, > Brandon > > [1] http://dev.rubyonrails.org/attachment/ticket/4245/ > symlinked_plugins.patch--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Brandon Keepers
2006-Dec-11 17:04 UTC
Re: ticket #4245 - Fix rake/generators for symlinked plugins
On Dec 11, 2006, at 11:47 AM, eclaymoore wrote:> > Brandon, > > I am a Rails user in practice and do not presume to know enough to > touch the internal code, but I am concerned by your patch to allow for > symlinked plugins. > > You are suggesting to change lines like this: > sources << PathSource.new(:plugins, > "#{::RAILS_ROOT}/vendor/plugins/**/generators") > To this: > sources << PathSource.new(:plugins, > "#{::RAILS_ROOT}/vendor/plugins/*/**/generators") > > I could be wrong, but wouldn''t allowing for symlinks to plugins keep > Windows users from accessing them? I have only seen symlinks used on > deployed servers (i.e. Capistrano), but what you are suggesting would > affect the windows developer environment directly. > > Can someone please chime in and confirm or debunk my concerns. > > Thank you, > Eric M.Nope, it shouldn''t (could someone with windows test this). /*/**/ really has nothing to do with symlinks. The pattern /**/ for Dir.glob gets a recursive directory listing, but it doesn''t follow symlinks (since doing so could send Ruby into a recursive spiral). However, the pattern /*/ will give you a (non-recursive) list of all the directories, including symlinks. So by combining them (/*/**/), it will follow one level of symlinks, and still look in all the directories recursively. Hope that helps. Brandon --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---