Hi all I want to add some rake tasks to my app using a plugin. So I added some tasks to vendor/plugins/my-plugin/Rakefile, but it seems that the tasks in a plugin''s Rakefile are not available to access from the application root, but you have to change directory to vendor/plugins/my-plugin. Is that correct? I''d really like to make my rake tasks from the plugin accessible by the whole application. How can I achieve this? Thanks a lot for help, Josh -- Posted via http://www.ruby-forum.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 -~----------~----~----~----~------~----~------~--~---
Jason Roelofs
2007-Mar-28 13:52 UTC
Re: Make rake tasks of a plugin accessible to the app?
Rails automatically loads vendor/plugins/my-plugin/lib/tasks/*.rake (following Rake''s auto-loading of lib/tasks/*.rake) So put the tasks you want showing up in a .rake file and you''re good to go. Jason On 3/28/07, Joshua Muheim <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Hi all > > I want to add some rake tasks to my app using a plugin. So I added some > tasks to vendor/plugins/my-plugin/Rakefile, but it seems that the tasks > in a plugin''s Rakefile are not available to access from the application > root, but you have to change directory to vendor/plugins/my-plugin. Is > that correct? > I''d really like to make my rake tasks from the plugin accessible by the > whole application. How can I achieve this? > > Thanks a lot for help, > Josh > > -- > Posted via http://www.ruby-forum.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 -~----------~----~----~----~------~----~------~--~---
Joshua Muheim
2007-Mar-28 19:33 UTC
Re: Make rake tasks of a plugin accessible to the app?
Jason Roelofs wrote:> Rails automatically loads vendor/plugins/my-plugin/lib/tasks/*.rake > (following Rake''s auto-loading of lib/tasks/*.rake) > > So put the tasks you want showing up in a .rake file and you''re good to > go. > > JasonThanks a lot =) -- Posted via http://www.ruby-forum.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 -~----------~----~----~----~------~----~------~--~---
This is true unless you want to run the rake task from cron. For some reason, when run from cron, it isnt looking in the vendor directory for the rake tasks. Im looking for a way to fix it. When I run Rake -T from a cron job I get the rake tasks including the ones in lib/task, but not the ones from the vendor directory. Any clue how to fix this? Joshua Muheim wrote:> Jason Roelofs wrote: >> Rails automatically loads vendor/plugins/my-plugin/lib/tasks/*.rake >> (following Rake''s auto-loading of lib/tasks/*.rake) >> >> So put the tasks you want showing up in a .rake file and you''re good to >> go. >> >> Jason > > Thanks a lot =)-- Posted via http://www.ruby-forum.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 -~----------~----~----~----~------~----~------~--~---