Hello, Why do we have to put "rails/init.rb" into a gem and not simply "init.rb" in main dir of a gem to make it behave like a plugin? Are there some special reasons for that? It would be cool to have one codebase which can be packaged as a gem or used as a classic plugin. On the other hand, some say (and I agree) plugins will perish in favor of gems - maybe we just should wait, or speed this process up by converting plugins into gems and not allowing to use them in old way by leaving only "rails/init.rb" and deleting "init.rb" from main dir? Cheers, Jacek --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Wed, May 28, 2008 at 4:36 AM, Jacek Becela <jacek.becela@gmail.com> wrote:> Why do we have to put "rails/init.rb" into a gem and not simply > "init.rb" in main dir of a gem to make it behave like a plugin? Are > there some special reasons for that?One reason would be to provide some namespacing of the init hook for gems that work with multiple frameworks, or have a purpose outside the context of Rails. -- Chad --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Wed, May 28, 2008 at 4:36 AM, Jacek Becela <jacek.becela@gmail.com> wrote:> Why do we have to put "rails/init.rb" into a gem and not simply > "init.rb" in main dir of a gem to make it behave like a plugin? Are > there some special reasons for that?One reason would be to provide some namespacing of the init hook for gems that work with multiple frameworks, or have a purpose outside the context of Rails. -- Chad --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> One reason would be to provide some namespacing of the init hook for > gems that work with multiple frameworks, or have a purpose outside the > context of Rails.Is init.rb in the main gem directory ever used by gems infrastucture? I couldn''t find any reference of that but I agree - it''s more aesthetic in rails dir and better in case of multiple frameworks. My conclusion is to keep init.rb in both dirs: main and rails, and make sure that only "rails/init.rb" is mentioned in gemspec, so the generated gem will be as clean as possible. -- Jacek --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Wed, May 28, 2008 at 9:50 AM, Jacek Becela <jacek.becela@gmail.com> wrote:> My conclusion is to keep init.rb in both dirs: main and rails, and > make sure that only "rails/init.rb" is mentioned in gemspec, so the > generated gem will be as clean as possible.Or make Rails look for it in either place in plugins, and only have it in rails/init.rb for gems. I thought this was already the case, but maybe it was just discussed and not implemented yet. -- Chad --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> Or make Rails look for it in either place in plugins, and only have it > in rails/init.rb for gems. I thought this was already the case, but > maybe it was just discussed and not implemented yet.It''s the case - it was not implemented, but I had a spare moment so I created a patch: http://rails.lighthouseapp.com/projects/8994/tickets/272-make-plugins-also-initialize-form-rails-init-rb#ticket-272-1 You are most welcome to look at it and maybe +1 :) -- Jacek --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---