Ingmar Hamer wrote: > Marnen Laibow-Koser wrote: >>> , where >>> Rake::Task#execute is documented. Next time, you may want to take those >>> 20 seconds before posting... >>> > > > Well, thanks for the reply. > > After feeling incredibly stupid for a couple of minutes I tried using > the methods given in the docs you linked to. > > Unfortunately I still can't get my task to run: > > my code in the controller: > > def test_rake > t = Rake::Task["doc:app"] > puts Rake::Task.task_defined?("doc:app") --> true > puts t.inspect() --> <Rake::Task doc:app => > [doc/app/index.html]> > puts t.name() --> doc:app > t.execute() --> returns nothing > t.invoke() --> returns false
It's not clear to me from looking at the source whether execute is supposed to return anything. Does the task in fact get run? > > #I found a line like this in another forum: > Rake::Task["rake:doc:app"].execute() --> also returns nothing > end This is of course equivalent to your other execute() call. (And you don't need parentheses if there are no arguments.) > > > When I run the "test_rake" method, I don't get any errors, but the task > still doesn't get executed... > > Where am I going wrong? I don't know if you are. Are you sure the task isn't being run? Does it work from the Rails console? 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 -~----------~----~----~----~------~----~------~--~---