Hi, I want to clear my logs files when they are exceeding certain limit of memory The size of the files can be determined by using the File.size() and I can clear the log files using the rake log:clear command But this has to be done through my application where i will create a method when the user clicks the logout button then the method checks the log files and if the files occupied more memory then it automatically refreshes the contents... Please help me how to achieve my requirement Thanks --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hema Gonaboina wrote:> Hi, > > I want to clear my logs files when they are exceeding certain limit > of > memory > The size of the files can be determined by using the File.size() and > I > can clear the log files using the rake log:clear command > But this has to be done through my application > where i will create a method when the user clicks the logout button > then > the method checks the log files and if the files occupied more memory > then > it automatically refreshes the contents... > Please help me how to achieve my requirement > > ThanksI think this will work: Rake::Task[''log:clear''].invoke -- 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 -~----------~----~----~----~------~----~------~--~---
Thank You But where I have to write the line Rake::Task[''log:clear''].invoke It is throwing exception as RAKE uninitialised constant... On Dec 15 2008, 12:41 am, Jeremy Weiskotten <rails-mailing- l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hema Gonaboina wrote: > > Hi, > > > I want to clear my logs files when they are exceeding certain limit > > of > > memory > > The size of the files can be determined by using the File.size() and > > I > > can clear the log files using the rake log:clear command > > But this has to be done through my application > > where i will create a method when the user clicks the logout button > > then > > the method checks the log files and if the files occupied more memory > > then > > it automatically refreshes the contents... > > Please help me how to achieve my requirement > > > Thanks > > I think this will work: > > Rake::Task[''log:clear''].invoke > -- > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
i guess this should work form anywhere. but pay attention: "RAKE" (all capitals) is expected to be a constant. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
edit: if it still fails, try something like this: require ''rake'' require ''rake/testtask'' require ''rake/rdoctask'' require ''tasks/rails'' after that, this should work Rake::Task[''taskname''].invoke --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Great... Thanks a lot... It is working Fine.. thank you very much On Jan 12, 2:28 pm, MaD <mayer.domi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> edit: if it still fails, try something like this: > require ''rake'' > require ''rake/testtask'' > require ''rake/rdoctask'' > require ''tasks/rails'' > > after that, this should work > Rake::Task[''taskname''].invoke--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---