Return to Snippet

Revision: 35606
at November 10, 2010 23:47 by alexkojin


Initial Code
namespace :server do 
  desc "restart server"
  task :restart do    
    system "thin restart -C /etc/thin/#{server_name}.yml"
  end 
  
  desc "stop server"
  task :stop do    
    system "thin stop -C /etc/thin/#{server_name}.yml"
  end 
    
  desc "start server"
  task :start do    
    system "thin start -C /etc/thin/#{server_name}.yml"
  end 
  
  def server_name
    File::basename(Rails.root)
  end
end

Initial URL

                                

Initial Description

                                

Initial Title
Thin server start/stop/restart

Initial Tags
server

Initial Language
Ruby