<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>.document</filename>
    </added>
    <added>
      <filename>LICENSE</filename>
    </added>
    <added>
      <filename>lib/ernie.rb</filename>
    </added>
    <added>
      <filename>test/ernie_test.rb</filename>
    </added>
    <added>
      <filename>test/test_helper.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,9 +1,61 @@
+require 'rubygems'
 require 'rake'
 
-ERLC_TEST_FLAGS = &quot;&quot;
-ERLC_FLAGS = &quot;-o ../ebin&quot;
+begin
+  require 'jeweler'
+  Jeweler::Tasks.new do |gem|
+    gem.name = &quot;ernie&quot;
+    gem.summary = %Q{TODO}
+    gem.email = &quot;tom@mojombo.com&quot;
+    gem.homepage = &quot;http://github.com/mojombo/ernie&quot;
+    gem.authors = [&quot;Tom Preston-Werner&quot;]
 
-task :default do
+    # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
+  end
+rescue LoadError
+  puts &quot;Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com&quot;
+end
+
+require 'rake/testtask'
+Rake::TestTask.new(:test) do |test|
+  test.libs &lt;&lt; 'lib' &lt;&lt; 'test'
+  test.pattern = 'test/**/*_test.rb'
+  test.verbose = true
+end
+
+begin
+  require 'rcov/rcovtask'
+  Rcov::RcovTask.new do |test|
+    test.libs &lt;&lt; 'test'
+    test.pattern = 'test/**/*_test.rb'
+    test.verbose = true
+  end
+rescue LoadError
+  task :rcov do
+    abort &quot;RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov&quot;
+  end
+end
+
+task :default =&gt; :test
+
+# require 'rake/rdoctask'
+# Rake::RDocTask.new do |rdoc|
+#   if File.exist?('VERSION.yml')
+#     config = YAML.load(File.read('VERSION.yml'))
+#     version = &quot;#{config[:major]}.#{config[:minor]}.#{config[:patch]}&quot;
+#   else
+#     version = &quot;&quot;
+#   end
+# 
+#   rdoc.rdoc_dir = 'rdoc'
+#   rdoc.title = &quot;ernie #{version}&quot;
+#   rdoc.rdoc_files.include('README*')
+#   rdoc.rdoc_files.include('lib/**/*.rb')
+# end
+
+task :ebuild do
+  ERLC_TEST_FLAGS = &quot;&quot;
+  ERLC_FLAGS = &quot;-o ../ebin&quot;
   cd &quot;elib&quot;
   sh &quot;erlc  #{ERLC_FLAGS} #{ERLC_TEST_FLAGS} #{Dir[&quot;**/*.erl&quot;].join(&quot; &quot;)}&quot;
 end
\ No newline at end of file</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -28,10 +28,50 @@ end
 require 'optparse'
 require 'pp'
 
-begin
-  ARGV[0] ? command = ARGV[0].downcase : (raise &quot;No command provided&quot;)
-  CMD_LINE_COMMANDS.include?(command) ? (require command) : (raise &quot;Invalid command&quot;)
-rescue =&gt; error
-  puts &quot;#{error.message}! Valid commands for ernie are:\n#{CMD_LINE_COMMANDS.sort.join(&quot;, &quot;)}&quot;
+options = {}
+OptionParser.new do |opts|
+  opts.banner = &quot;Usage: ernie [options] &lt;handler&gt;&quot;
+
+  opts.on(&quot;-n NAME&quot;, &quot;--name NAME&quot;, &quot;Node name&quot;) do |x|
+    options[:name] = x
+  end
+
+  opts.on(&quot;-p PORT&quot;, &quot;--port PORT&quot;, &quot;Port&quot;) do |x|
+    options[:port] = x
+  end
+
+  opts.on(&quot;-d&quot;, &quot;--detached&quot;, &quot;Run as a daemon&quot;) do
+    options[:detached] = true
+  end
+
+  opts.on(&quot;-P&quot;, &quot;--pidfile PIDFILE&quot;, &quot;Location to write pid file.&quot;) do |x|
+    options[:pidfile] = x
+  end
+end.parse!
+
+handler = ARGV[0]
+
+unless handler
+  puts &quot;A handler must be specified: ernie /path/to/handler.rb&quot;
   exit(1)
-end
\ No newline at end of file
+end
+
+name = options[:name] || DEFAULT_NODE_NAME
+port = options[:port] || 8000
+pidfile = options[:pidfile] ? &quot;-ernie_server_app pidfile \&quot;'#{options[:pidfile]}'\&quot;&quot; : ''
+detached = options[:detached] ? '-detached' : ''
+
+cmd = %Q{erl -boot start_sasl \
+             #{detached} \
+             +Bc \
+             +K true \
+             -smp enable \
+             #{code_paths}
+             -name '#{name}' \
+             #{pidfile} \
+             -setcookie #{cookie_hash(name)} \
+             -ernie_server_app port #{port} \
+             -ernie_server_app handler '&quot;#{handler}&quot;' \
+             -run ernie_server_app boot}.squeeze(' ')
+puts cmd
+exec(cmd)
\ No newline at end of file</diff>
      <filename>bin/ernie</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>lib/cli/server.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>210fdd51292934dec8db0b1bcca11d798418c103</id>
    </parent>
  </parents>
  <author>
    <name>Tom Preston-Werner</name>
    <email>tom@mojombo.com</email>
  </author>
  <url>http://github.com/mojombo/ernie/commit/e172632946d19b56b7c822f154fac2ad9abd153d</url>
  <id>e172632946d19b56b7c822f154fac2ad9abd153d</id>
  <committed-date>2009-05-18T16:40:10-07:00</committed-date>
  <authored-date>2009-05-18T16:40:10-07:00</authored-date>
  <message>add tests and unify cli</message>
  <tree>51aa82ae4d1a74d86203055614c9e30c5b023e1e</tree>
  <committer>
    <name>Tom Preston-Werner</name>
    <email>tom@mojombo.com</email>
  </committer>
</commit>
