Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

root/trunk/railties/lib/tasks/tmp.rake

Revision 4294, 0.9 kB (checked in by david, 3 years ago)

Added pid file usage to script/process/spawner and script/process/reaper along with a directive in default config/lighttpd.conf file to record the pid. They will all save their pid file in tmp/pids [DHH]

Line 
1 namespace :tmp do
2   desc "Clear session, cache, and socket files from tmp/"
3   task :clear => [ "tmp:sessions:clear",  "tmp:cache:clear", "tmp:sockets:clear"]
4
5   desc "Creates tmp directories for sessions, cache, and sockets"
6   task :create do
7     FileUtils.mkdir_p(%w( tmp/sessions tmp/cache tmp/sockets tmp/pids ))
8   end
9
10   namespace :sessions do
11     desc "Clears all files in tmp/sessions"
12     task :clear do
13       FileUtils.rm(Dir['tmp/sessions/[^.]*'])
14     end
15   end
16
17   namespace :cache do
18     desc "Clears all files and directories in tmp/cache"
19     task :clear do
20       FileUtils.rm_rf(Dir['tmp/cache/[^.]*'])
21     end
22   end
23
24   namespace :sockets do
25     desc "Clears all files in tmp/sockets"
26     task :clear do
27       FileUtils.rm(Dir['tmp/sockets/[^.]*'])
28     end
29   end
30
31   namespace :pids do
32     desc "Clears all files in tmp/pids"
33     task :clear do
34       FileUtils.rm(Dir['tmp/pids/[^.]*'])
35     end
36   end
37 end
Note: See TracBrowser for help on using the browser.