Ingmar Hamer wrote: > Leonardo Mateo wrote: > >> Just a guess, since I haven't ever had this situation but, rake files >> are ruby files, you should be able to include them from any other ruby >> file and execute the methods it has defined inside. >> As I said, I haven't tried this, is just a guess. > >> >> Otherwise, you can always use a system call to execute system commands >> (such as rake) >> > > Hi Leonardo > > I think you're spot on with your answers. It's exactly what I tried to > do (in that order, too ;-) > > The problem is that the task simply doesnt get executed when I try > running it from the controller: > > If I do s.th. like this in my controller: > > require 'rake' > Rake::Task["doc:app"] > > --> the app runs without error but the rake task doesn't get executed > > however if I use a random 'task' name: > require 'rake' > Rake::Task["foo:bar"] > -->Error: Don't know how to build task 'foo:bar' > > So it does seem like my code gets evaluated but the rake task is just > not executed. Am I missing something like an explicit "run task" > command?!
It seems that you are. Although I've never done anything like this, 20 seconds of reading docs led me to http://bit.ly/apUVw , where Rake::Task#execute is documented. Next time, you may want to take those 20 seconds before posting... Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---