<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -25,7 +25,16 @@ sudo gem install -l god_web-*.gem
 
 h2. Usage
 
-@sudo god_web -p PORT_TO_RUN_ON -e production@
+In your God config:
+
+&lt;pre&gt;
+&lt;code&gt;
+require 'god_web'
+GodWeb.watch
+&lt;/code&gt;
+&lt;/pre&gt;
+
+This will create a God watch that runs and monitors GodWeb on port 8888.
 
 Optionally, you can password protect your @god_web@ instance. To do so, create
 a YAML config file with username and password keys, like so:
@@ -37,51 +46,13 @@ password: sekret
 &lt;/code&gt;
 &lt;/pre&gt;
 
-Then provide that yaml file as the first argument to @god_web@:
-
-@sudo god_web /path/to/god_web.yml -p PORT_TO_RUN_ON -e production@
-
-You might want to monitor @god_web@ to make sure it stays up:
+Then provide the full path to that yaml file as an option to the @GodWeb.watch@
+call: 
 
 &lt;pre&gt;
 &lt;code&gt;
-God.watch do |w|
-  w.name              = &quot;god_web&quot;
-  w.interval          = 1.minute
-  w.start             = &quot;sudo god_web -e prodction -p 8888&quot;
-  w.start_grace       = 10.seconds
-  w.restart_grace     = 10.seconds
-
-  w.start_if do |start|
-    start.condition(:process_running) do |c|
-      c.running = false
-    end
-  end
-
-  w.restart_if do |restart|
-    restart.condition(:memory_usage) do |c|
-      c.above = 20.megabytes
-      c.times = [3, 5]
-    end
-
-    restart.condition(:cpu_usage) do |c|
-      c.above = 25.percent
-      c.times = 5
-    end
-  end
-
-  w.lifecycle do |on|
-    on.condition(:flapping) do |c|
-      c.to_state = [:start, :restart]
-      c.times = 5
-      c.within = 5.minute
-      c.transition = :unmonitored
-      c.retry_in = 10.minutes
-      c.retry_times = 5
-      c.retry_within = 2.hours
-    end
-  end
-end
+require 'god_web'
+GodWeb.watch(:config =&gt; '/full/path/to/god_web.yaml')
 &lt;/code&gt;
 &lt;/pre&gt;
 </diff>
      <filename>Readme.textile</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,49 @@ class GodWeb
     ping
   end
 
+  def self.watch(options = {})
+    options[:port] ||= 8888
+    options[:environment] ||= 'production'
+    start_string = &quot;god_web #{options[:config]} -e #{options[:environment]} -p #{options[:port]}&quot;
+    God.watch do |w|
+      w.name              = &quot;god_web&quot;
+      w.interval          = 1.minute
+      w.start             = &quot;god_web -e production -p 8888&quot;
+      w.start_grace       = 10.seconds
+      w.restart_grace     = 10.seconds
+
+      w.start_if do |start|
+        start.condition(:process_running) do |c|
+          c.running = false
+        end
+      end
+
+      w.restart_if do |restart|
+        restart.condition(:memory_usage) do |c|
+          c.above = 20.megabytes
+          c.times = [3, 5]
+        end
+
+        restart.condition(:cpu_usage) do |c|
+          c.above = 25.percent
+          c.times = 5
+        end
+      end
+
+      w.lifecycle do |on|
+        on.condition(:flapping) do |c|
+          c.to_state = [:start, :restart]
+          c.times = 5
+          c.within = 5.minute
+          c.transition = :unmonitored
+          c.retry_in = 10.minutes
+          c.retry_times = 5
+          c.retry_within = 2.hours
+        end
+      end
+    end
+  end
+
   def setup
     DRb.start_service
     @server = DRbObject.new(nil, God::Socket.socket(@config['god_port']))</diff>
      <filename>lib/god_web.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>4f69fa6f7bfb3c3a354d9596803af49900fb15f7</id>
    </parent>
  </parents>
  <author>
    <name>Jesse Newland</name>
    <email>jnewland@gmail.com</email>
  </author>
  <url>http://github.com/jnewland/god_web/commit/c7338484d530db817ce72fb8a1a44b9a68ea667e</url>
  <id>c7338484d530db817ce72fb8a1a44b9a68ea667e</id>
  <committed-date>2008-07-08T08:08:11-07:00</committed-date>
  <authored-date>2008-07-08T08:08:11-07:00</authored-date>
  <message>provide a convenience method for starting GodWeb in God, adjust documentation accordingly</message>
  <tree>bd449d78e93ebee143253532f221e6a5d0291740</tree>
  <committer>
    <name>Jesse Newland</name>
    <email>jnewland@gmail.com</email>
  </committer>
</commit>
