DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Ruslan has posted 8 posts at DZone. View Full User Profile

Rake Task For Restart Rails Application Runed On Mod_rails

05.27.2008
| 6303 views |
  • submit to reddit
        
amespace :passenger do
  desc "Restart Application"
  task :restart do
    puts `touch tmp/restart.txt`
  end
end
    

Comments

Snippets Manager replied on Sun, 2007/06/10 - 2:26pm

Great idea! Never had the idea to put it into a rake task. A friend of mine slightly pimped this snippet, so you can run the rake task from everywhere and on every system (no touch cmd on windows). require 'fileutils' namespace :passenger do desc "Restart Application" task :restart do FileUtils.touch "#{RAILS_ROOT}/tmp/restart.txt" end end