<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>templates/boot.erb</filename>
    </added>
    <added>
      <filename>templates/connections.yml.erb</filename>
    </added>
    <added>
      <filename>templates/debug_handler.erb</filename>
    </added>
    <added>
      <filename>templates/hello_world.erb</filename>
    </added>
    <added>
      <filename>templates/rakefile.erb</filename>
    </added>
    <added>
      <filename>templates/settings.yml.erb</filename>
    </added>
    <added>
      <filename>templates/setup.erb</filename>
    </added>
    <added>
      <filename>templates/test_helper.erb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,30 +1,61 @@
+require 'rubygems'
+require 'rake'
 require 'rake/testtask'
+require 'rake/gempackagetask'
+require File.join(File.dirname(__FILE__), &quot;lib&quot;, &quot;marvin&quot;)
 
-begin
-  require 'jeweler'
-  Jeweler::Tasks.new do |s|
-    s.name        = &quot;marvin&quot;
-    s.summary     = &quot;Ruby IRC Library / Framework&quot;
-    s.email       = &quot;sutto@sutto.net&quot;
-    s.homepage    = &quot;http://blog.ninjahideout.com/&quot;
-    s.description = &quot;Marvin is a Ruby IRC library / framework for ultimate awesomeness and with an evented design.&quot;
-    s.authors     = [&quot;Darcy Laycock&quot;]
-    # Non-standard files to be included.
-    extras        = [&quot;config/setup.rb&quot;, &quot;config/boot.rb&quot;, &quot;config/settings.yml.sample&quot;, &quot;config/connections.yml.sample&quot;]
-    s.files       = FileList[&quot;[A-Z]*.*&quot;, &quot;{bin,generators,lib,test,spec,script,handlers}/**/*&quot;] + extras
-    s.executables = &quot;marvin&quot;
-    # Our dependencies
-    s.add_dependency &quot;Sutto-perennial&quot;
-    s.add_dependency &quot;eventmachine&quot;,  &quot;&gt;= 0.12.0&quot;
-  end
-rescue LoadError
-  puts &quot;Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com&quot;
+spec = Gem::Specification.new do |s|
+  s.name     = 'marvin'
+  s.email    = 'sutto@sutto.net'
+  s.homepage = 'http://sutto.net/'
+  s.authors  = [&quot;Darcy Laycock&quot;]
+  s.version  = Marvin.version(ENV['RELEASE'].blank?)
+  s.summary  = &quot;Evented IRC Library of Doom&quot;
+  s.files    = FileList[&quot;{bin,lib,templates,test,handlers}/**/*&quot;].to_a
+  s.platform = Gem::Platform::RUBY
+  s.add_dependency &quot;Sutto-perennial&quot;,           &quot;&gt;= 0.2.4.6&quot;
+  s.add_dependency &quot;eventmachine-eventmachine&quot;, &quot;&gt;= 0.12.9&quot;
+  s.add_dependency &quot;json&quot;
+end
+
+task :default =&gt; &quot;test:units&quot;
+
+namespace :test do
+  desc &quot;Runs the unit tests for perennial&quot;
+  Rake::TestTask.new(&quot;units&quot;) do |t|
+    t.pattern = 'test/*_test.rb'
+    t.libs &lt;&lt; 'test'
+    t.verbose = true
+  end  
+end
+
+
+Rake::GemPackageTask.new(spec) do |pkg|
+  pkg.need_zip = true
+  pkg.need_tar = true
 end
 
-task :default =&gt; &quot;test&quot;
+task :gemspec do
+  File.open(&quot;marvin.gemspec&quot;, &quot;w+&quot;) { |f| f.puts spec.to_ruby }
+end
+
+def gemi(name, version)
+  command = &quot;gem install #{name} --version '#{version}' --source http://gems.github.com&quot;
+  puts &quot;&gt;&gt; #{command}&quot;
+  system &quot;#{command} 1&gt; /dev/null 2&gt; /dev/null&quot;
+end
 
-Rake::TestTask.new do |t|
- t.libs &lt;&lt; &quot;test&quot;
- t.test_files = FileList['test/*_test.rb']
- t.verbose = true
+task :install_dependencies do
+  spec.dependencies.each do |dependency|
+    gemi dependency.name, dependency.requirement_list.first
+  end
+end
+
+task :tag do
+  if `git rev-parse HEAD` != `git rev-parse origin/master`
+    puts &quot;You have uncommited changes. Please commit / stash them and rerun&quot;
+  end
+  command = &quot;git tag -a v#{Marvin.version(ENV['RELEASE'].blank?)}&quot;
+  puts command
+  
 end
\ No newline at end of file</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,160 +1,33 @@
 #!/usr/bin/env ruby
 require 'rubygems'
-require 'fileutils'
-require &quot;thor&quot;
+require File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;lib&quot;, &quot;marvin&quot;)
 
-class Marvin &lt; Thor
+Marvin::Application.processing(ARGV) do |a|
   
-  GEM_ROOT = File.expand_path(File.join(File.dirname(__FILE__), &quot;..&quot;))
+  a.banner = &quot;Marvin v#{Marvin::VERSION} - An IRC Library for Ruby&quot;
   
-  attr_accessor :dest
+  a.generator!
   
-  # Map default help tasks.
-  map [&quot;-h&quot;, &quot;-?&quot;, &quot;--help&quot;, &quot;-D&quot;] =&gt; :help
+  a.option      :development, &quot;Runs the app in development mode (handler reloading)&quot;, :shortcut =&gt; &quot;D&quot;
+  a.controller! :client, &quot;Starts the actual Marvin client instance&quot;
+  a.controller! :console, &quot;Opens a friendly IRB prompt with Marvin pre-loaded&quot;
+  a.controller! :distributed_client, &quot;Starts a distributed client instance&quot;
   
-  desc &quot;create [PATH]&quot;, &quot;creates a new marvin app at the given path&quot;
-  method_options :verbose =&gt; :boolean
-  def create(path)
-    @dest    = File.expand_path(path)
-    @verbose = options[:verbose]
-    if File.directory?(@dest)
-      STDOUT.puts &quot;The given directory, \&quot;#{path}\&quot;, already exists.&quot;
-      exit! 1
-    else
-      say &quot;Creating Marvin app&quot;
-      say &quot; =&gt; Making directories&quot;
-      mkdir   @dest
-      mkdir   source(@dest, &quot;script&quot;)
-      mkdir   source(@dest, &quot;config&quot;)
-      mkdir   source(@dest, &quot;handlers&quot;)
-      mkdir_p source(@dest, &quot;tmp/pids&quot;)
-      mkdir   source(@dest, &quot;log&quot;)
-      mkdir   source(@dest, &quot;lib&quot;)
-      say &quot; =&gt; Copying files...&quot;
-      copy &quot;config/setup.rb&quot;
-      copy &quot;config/boot.rb&quot;
-      copy &quot;config/connections.yml.sample&quot;, &quot;config/connections.yml&quot;
-      copy &quot;config/settings.yml.sample&quot;,    &quot;config/settings.yml&quot;
-      copy &quot;handlers/hello_world.rb&quot;
-      copy &quot;handlers/debug_handler.rb&quot;
-      %w(client console distributed_client ring_server status).each do |c|
-        copy &quot;script/#{c}&quot;
-        FileUtils.chmod 0755, source(@dest, &quot;script/#{c}&quot;)
-      end
-      say &quot;Done!&quot;
-    end
-  end
-  
-  map &quot;cl&quot; =&gt; :client, &quot;st&quot; =&gt; :status, &quot;rs&quot; =&gt; :ring_server,
-      &quot;dc&quot; =&gt; :distributed_client, &quot;co&quot; =&gt; :console
-  
-  desc &quot;start [PATH]&quot;, &quot;starts client at the given path&quot;
-  method_options :verbose =&gt; :boolean, :daemon =&gt; :boolean, :level =&gt; :optional, :kill =&gt; :boolean
-  def start(path = &quot;.&quot;)
-    @dest = File.expand_path(path)
-    start_script(:client)
-  end
-  
-  desc &quot;status [PATH]&quot;, &quot;shows status of marvin app at a given location&quot;
-  def status(path = &quot;.&quot;)
-    @dest = File.expand_path(path)
-    start_script(:status)
-  end
-  
-  desc &quot;client [PATH]&quot;, &quot;starts a client instance from the given location&quot;
-  method_options :verbose =&gt; :boolean, :daemon =&gt; :boolean, :level =&gt; :optional, :kill =&gt; :boolean
-  def client(path = &quot;.&quot;)
-    @dest = File.expand_path(path)
-    start_script(:client)
-  end
-  
-  desc &quot;ring_server [PATH]&quot;, &quot;starts a ring server from the given location&quot;
-  method_options :verbose =&gt; :boolean, :daemon =&gt; :boolean, :level =&gt; :optional, :kill =&gt; :boolean
-  def ring_server(path = &quot;.&quot;)
-    @dest = File.expand_path(path)
-    start_script(:ring_server)
-  end
-  
-  desc &quot;distributed_client [PATH]&quot;, &quot;starts a distributed client from the given location&quot;
-  method_options :verbose =&gt; :boolean, :daemon =&gt; :boolean, :level =&gt; :optional,
-                 :kill =&gt; :boolean, :nodes =&gt; :numeric
-  def distributed_client(path = &quot;.&quot;)
-    @dest = File.expand_path(path)
-    start_script(:distributed_client)
-  end
-  
-  desc &quot;console [PATH]&quot;, &quot;starts a marvin console from the given location&quot;
-  def console(path = &quot;.&quot;)
-    @dest = File.expand_path(path)
-    start_script(:console)
-  end
-  
-  private
-  
-  def source(*args)
-    File.expand_path(File.join(*args))
-  end
-  
-  def copy(from, to = from)
-    s, d = source(GEM_ROOT, from), source(@dest, to)
-    say &quot; --&gt; cp #{s.gsub(&quot; &quot;, &quot;\\ &quot;)} #{d.gsub(&quot; &quot;, &quot;\\ &quot;)}&quot; if @verbose
-    FileUtils.cp_r(s, d)
-  end
-  
-  def mkdir(path)
-    say &quot; --&gt; mkdir #{path.gsub(&quot; &quot;, &quot;\\ &quot;)}&quot; if @verbose
-    FileUtils.mkdir path
-  end
-  
-  def mkdir_p(path)
-    say &quot; --&gt; mkdir #{path.gsub(&quot; &quot;, &quot;\\ &quot;)}&quot; if @verbose
-    FileUtils.mkdir_p path
-  end
-  
-  def say(text)
-    STDOUT.puts text
-  end
-  
-  def marvin_repo?(path, type = client)
-    File.directory?(source(path, &quot;script&quot;)) &amp;&amp; File.exist?(source(path, &quot;script/#{type}&quot;))
-  end
-  
-  def start_script(name)
-    if marvin_repo?(@dest, name)
-      extra_args = []
-      extra_args &lt;&lt; &quot;-k&quot; if options[:kill]
-      extra_args &lt;&lt; &quot;-v&quot; if options[:verbose]
-      extra_args &lt;&lt; &quot;-d&quot; if options[:daemon]
-      extra_args &lt;&lt; &quot;--level=#{options[:level]}&quot; if options[:level]
-      if options[:daemon] &amp;&amp; options[:nodes]
-        nodes = options[:nodes]
-      else
-        nodes = 1
-      end
-      Dir.chdir(@dest) do
-        # Lets you start a number of different processes.
-        # uses system if there are more than 1 nodes, exec
-        # otherwise.
-        if nodes &gt; 1
-          nodes.times { system(&quot;script/#{name}&quot;, *extra_args) }
-        else
-          exec(&quot;script/#{name}&quot;, *extra_args)
-        end
-      end
-    else
-      STDOUT.puts &quot;Woop! #{@dest.gsub(&quot; &quot;, &quot;\\ &quot;)} isn't a marvin app.&quot;
+  a.option :force, &quot;force the creation of the application&quot;
+  a.add &quot;create PATH&quot;, &quot;Creates a marvin application at the given location&quot; do |path, options|
+    path = File.expand_path(path)
+    if File.exists?(path) &amp;&amp; !options[:force]
+      die! &quot;The path you tried to use, #{path}, already exists. Please try another or use the --force option&quot;
     end
+    setup_generator(path)
+    folders 'tmp', 'config', 'lib', 'handlers', 'test'
+    template 'boot.erb',            'config/boot.rb'
+    template 'setup.erb',           'config/setup.rb'
+    template 'settings.yml.erb',    'config/settings.yml'
+    template 'connections.yml.erb', 'config/connections.yml'
+    template 'debug_handler.erb',   'handlers/debug_handler.rb'
+    template 'hello_world.erb',     'handlers/hello_world.rb'
+    template 'rakefile.erb',        'Rakefile'
   end
   
 end
-
-STDOUT.puts &quot;Marvin - IRC Library / Framework for Ruby&quot;
-
-# Check if we have arguments, we run the normal
-# thor task otherwise we just print the help
-# message.
-if ARGV.empty?
-  Marvin.new.help
-else
-  Marvin.start
-end
\ No newline at end of file</diff>
      <filename>bin/marvin</filename>
    </modified>
    <modified>
      <diff>@@ -4,15 +4,12 @@
 # any connections are created
 Marvin::Loader.before_run do
   
-  # Want a non-default namespace? Choose something simple
-  # Marvin::Settings.distributed_namespace = :some_namespace
-  
   # E.G.
   # MyHandler.register! (Marvin::Base subclass) or
   # Marvin::Settings.client.register_handler my_handler (a handler instance)
   
   # Register based on some setting you've added. e.g.:
-  # LoggingHandler.register! if Marvin::Settings.use_logging
+  # LoggingHandler.register! if Marvin::Settings.use_logging?
   
   # Conditional registration - load the distributed dispatcher
   # if an actual client, otherwise use the normal handlers.
@@ -21,18 +18,14 @@ Marvin::Loader.before_run do
   #   HelloWorld.register!
   #   DebugHandler.register!
   # else
+  #   Marvin::Distributed::Handler.register!
+  # else
   
   # end
   
-  if Marvin::Loader.distributed_client?
-    KeikiThwopper.register!
-  end
-  
-  Marvin::Distributed::Handler.register!
-  
-  # And any other code here that will be run before the client
+  # And any other code here that will be run before the client, e.g:
   
-  HelloWorld.register!
-  DebugHandler.register!
+  # HelloWorld.register!
+  # DebugHandler.register!
   
 end
\ No newline at end of file</diff>
      <filename>config/setup.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@ require 'perennial'
 module Marvin
   include Perennial
   
-  VERSION = &quot;0.5.0&quot;
+  VERSION = [0, 8, 0, 0]
   
   # Misc.
   #autoload :Util,             'marvin/util'
@@ -45,6 +45,10 @@ module Marvin
     
   end
   
+  def self.version(include_minor = false)
+    VERSION[0, (include_minor ? 4 : 3)].join(&quot;.&quot;)
+  end
+  
   has_library :util, :abstract_client, :abstract_parser, :irc, :exception_tracker
   
   extends_library :settings</diff>
      <filename>lib/marvin.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>VERSION.yml</filename>
    </removed>
    <removed>
      <filename>bin/marvin_new</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>03c8c67bf3966a765126fb197268ce417e49549b</id>
    </parent>
  </parents>
  <author>
    <name>Darcy Laycock</name>
    <email>sutto@sutto.net</email>
  </author>
  <url>http://github.com/Sutto/marvin/commit/315900f9d6accc371e53200b82c6a6d65e81a001</url>
  <id>315900f9d6accc371e53200b82c6a6d65e81a001</id>
  <committed-date>2009-09-15T20:29:37-07:00</committed-date>
  <authored-date>2009-09-15T20:29:37-07:00</authored-date>
  <message>Refactor - remove jeweler, add new binary</message>
  <tree>90cffb948b9ed283757b97b9e4c343243f88ebcd</tree>
  <committer>
    <name>Darcy Laycock</name>
    <email>sutto@sutto.net</email>
  </committer>
</commit>
