<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/gitjour/application.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -7,8 +7,8 @@ Rakefile
 config/hoe.rb
 config/requirements.rb
 lib/gitjour.rb
+lib/gitjour/application.rb
 lib/gitjour/version.rb
-log/debug.log
 script/destroy
 script/generate
 script/txt2html</diff>
      <filename>Manifest.txt</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1,8 @@
-README
\ No newline at end of file
+README
+
+DEVELOPMENT
+
+How to test from the console:
+
+irb -r 'lib/gitjour/application'
+&gt; Gitjour::Application.run &quot;list&quot;</diff>
      <filename>README.txt</filename>
    </modified>
    <modified>
      <diff>@@ -1,38 +1,14 @@
 #!/usr/bin/env ruby
 require 'rubygems'
-require 'dnssd'
-require 'set'
 require 'cooloptions'
-
-Thread.abort_on_exception = true
-
-GitService = Struct.new(:name, :host, :port, :description)
-
-def service_list(looking_for = nil)
-  wait_seconds = 5
-  
-  service_list = Set.new  
-  waiting_thread = Thread.new { sleep wait_seconds }
-  
-  service = DNSSD.browse &quot;_git._tcp&quot; do |reply|
-    DNSSD.resolve reply.name, reply.type, reply.domain do |resolve_reply|
-      service_list &lt;&lt; GitService.new(reply.name, resolve_reply.target, resolve_reply.port, resolve_reply.text_record['description'])
-      if looking_for &amp;&amp; reply.name == looking_for
-        waiting_thread.kill
-      end
-    end
-  end
-  puts &quot;Gathering for up to #{wait_seconds} seconds...&quot;
-  waiting_thread.join
-  service.stop 
-  service_list
-end
+require 'gitjour'
 
 COMMANDS = {
   'list' =&gt; 'Lists available repositories.',
   'clone' =&gt; 'Clone a gitjour served repository.',
   'serve' =&gt; 'Serve up the current directory via gitjour.'
 }
+
 options = CoolOptions.parse!(&quot;[options] command [name]&quot;) do |o|
   o.desc 'Serve up and use git repositories via Bonjour/DNSSD.'
   o.desc &quot;\n&quot;
@@ -45,33 +21,16 @@ options = CoolOptions.parse!(&quot;[options] command [name]&quot;) do |o|
   o.desc &quot;\n&quot;
   
   o.desc &quot;Options:&quot;
-  o.on 'port PORT', &quot;Pass to serve to serve on a different port.&quot;, 9148
+  o.on 'port PORT', &quot;Pass to serve to serve on a different port.&quot;, 9418
+  o.on 'verbose',   &quot;Verbose output.&quot;, false
   
   o.after do |result|
     (result.command = ARGV.shift) || o.error(&quot;Command is required.&quot;)
     o.error(&quot;Unknown command.&quot;) if !COMMANDS.keys.include?(result.command)
     result.name = ARGV.shift
     o.error(&quot;Name is required.&quot;) if result.command == &quot;clone&quot; &amp;&amp; !result.name
+    result.port = result.port.to_i
   end
 end
 
-case options.command
-  when &quot;list&quot;
-    service_list.each do |service|
-      puts &quot;#{service.name} on #{service.host}: gitjour clone #{service.name}&quot;
-    end
-  when &quot;clone&quot;
-    name_of_share = options.name
-    service = service_list(options.name).detect{|service| service.name == options.name}
-    system(&quot;git clone git://#{service.host}:#{service.port}/ #{options.name}&quot;)
-  when &quot;serve&quot;
-    name = options.name || File.basename(Dir.pwd)
-    tr = DNSSD::TextRecord.new
-    tr['description'] = File.read(&quot;.git/description&quot;) rescue &quot;a git project&quot;
-    DNSSD.register(name, &quot;_git._tcp&quot;, 'local', options.port.to_i, tr.encode) do |register_reply| 
-      p register_reply
-    end
-    `git-daemon --verbose --export-all --base-path=#{Dir.pwd} --port=#{options.port}`
-end
-
-
+Gitjour::Application.run(options)</diff>
      <filename>bin/gitjour</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1 @@
-$:.unshift File.dirname(__FILE__)
-
-module Gitjour
-  
-end
\ No newline at end of file
+require 'gitjour/application'</diff>
      <filename>lib/gitjour.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 module Gitjour #:nodoc:
   module VERSION #:nodoc:
-    MAJOR = 3
+    MAJOR = 6
     MINOR = 0
     TINY  = 0
 </diff>
      <filename>lib/gitjour/version.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>261a4d7c7adb514b0cd146192ba7a18603368e9c</id>
    </parent>
  </parents>
  <author>
    <name>Nathaniel Talbott</name>
    <email>nathaniel@terralien.com</email>
  </author>
  <url>http://github.com/dustin/gitjour/commit/e196aba33446f14ce80f8709e5137b45f8aa8fb6</url>
  <id>e196aba33446f14ce80f8709e5137b45f8aa8fb6</id>
  <committed-date>2008-05-31T16:19:15-07:00</committed-date>
  <authored-date>2008-05-31T16:19:15-07:00</authored-date>
  <message>Merged latest.</message>
  <tree>8673845a4bc0800d41c8a3e593f4453276aaacd1</tree>
  <committer>
    <name>Nathaniel Talbott</name>
    <email>nathaniel@terralien.com</email>
  </committer>
</commit>
