Christopher J. Bottaro
2007-Oct-22 02:40 UTC
how to run a rake task from plugin''s install.rb?
Hello, I wrote a plugin that adds some rake tasks. Upon installation of my plugin, I would like one of these rake tasks to be run. How do I do that in install.rb? Thank you. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Chris Wanstrath
2007-Oct-22 07:46 UTC
Re: how to run a rake task from plugin''s install.rb?
On 10/21/07, Christopher J. Bottaro <cjbottaro-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello,Hello.> I wrote a plugin that adds some rake tasks. Upon installation of my > plugin, I would like one of these rake tasks to be run. How do I do > that in install.rb?Rake::Task[''task:name''].invoke -- Chris Wanstrath http://errfree.com // http://errtheblog.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Christopher J. Bottaro
2007-Oct-22 15:50 UTC
Re: how to run a rake task from plugin''s install.rb?
On Oct 22, 2:46 am, "Chris Wanstrath" <ch...-G5sj8e7vJc8@public.gmane.org> wrote:> Rake::Task[''task:name''].invokeI tried that and then ''script/plugin install'' wouldn''t install it cleanly anymore. When a plugin is installed, how/when is the install.rb file invoked? I mean, in that file, can I count on the Rails environment already being loaded? Also, how do I test that file? I can''t simply say "ruby install.rb" unless I load all the environment stuff myself in that file. Thanks for the help. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---