<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,42 @@
+port = 3030
+
+desc &quot;Start the app server&quot;
+task :start =&gt; :stop do
+	puts &quot;Starting the blog&quot;
+	system &quot;ruby main.rb -p #{port} &gt; access.log 2&gt;&amp;1 &amp;&quot;
+end
+
+# code lifted from rush
+def process_alive(pid)
+	::Process.kill(0, pid)
+	true
+rescue Errno::ESRCH
+	false
+end
+
+def kill_process(pid)
+	::Process.kill('TERM', pid)
+
+	5.times do
+		return if !process_alive(pid)
+		sleep 0.5
+		::Process.kill('TERM', pid) rescue nil
+	end
+
+	::Process.kill('KILL', pid) rescue nil
+rescue Errno::ESRCH
+end
+
+desc &quot;Stop the app server&quot;
+task :stop do
+	m = `netstat -lptn | grep 0.0.0.0:#{port}`.match(/LISTEN\s*(\d+)/)
+	if m
+		pid = m[1].to_i
+		puts &quot;Killing old server #{pid}&quot;
+		kill_process(pid)
+	end
+end
+
 task :environment do
 	require 'sequel'
 	DB = Sequel.connect('sqlite://blog.db')</diff>
      <filename>Rakefile</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>517a6bac03842a1b255706f809e19bc8e1ae5029</id>
    </parent>
  </parents>
  <author>
    <name>Adam Wiggins</name>
    <email>adam@heroku.com</email>
  </author>
  <url>http://github.com/adamwiggins/scanty/commit/7cff2f58f40a92a080f2388e9cd292704b5528de</url>
  <id>7cff2f58f40a92a080f2388e9cd292704b5528de</id>
  <committed-date>2008-11-04T14:44:39-08:00</committed-date>
  <authored-date>2008-11-01T15:27:44-07:00</authored-date>
  <message>rake start/stop</message>
  <tree>3a5c187eb2bfb353474949376a60840df7c9bbf8</tree>
  <committer>
    <name>Adam Wiggins</name>
    <email>adam@heroku.com</email>
  </committer>
</commit>
