<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>CHANGELOG</filename>
    </added>
    <added>
      <filename>README</filename>
    </added>
    <added>
      <filename>TODO</filename>
    </added>
    <added>
      <filename>doc/jamis.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,45 +1,82 @@
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-require 'spec/rake/spectask'
+# Copyright 2008 Scott Barron (scott@elitists.net)
+# All rights reserved
 
-desc 'Default: run unit tests.'
-task :default =&gt; [:clean_db, :test]
+# This file may be distributed under an MIT style license.
+# See MIT-LICENSE for details.
 
-desc 'Remove the stale db file'
-task :clean_db do
-  `rm -f #{File.dirname(__FILE__)}/test/state_machine.sqlite.db`
+begin
+  require 'rubygems'
+  require 'rake/gempackagetask'
+  require 'rake/testtask'
+  require 'rake/rdoctask'
+  require 'spec/rake/spectask'
+rescue Exception
+  nil
 end
 
-desc 'Test the acts as state machine plugin.'
-Rake::TestTask.new(:test) do |t|
-  t.libs &lt;&lt; 'lib'
-  t.pattern = 'test/**/*_test.rb'
-  t.verbose = true
-end
+# Version
+CURRENT_VERSION = '0.0.0'
+$package_version = CURRENT_VERSION
+
+PKG_FILES = FileList['[A-Z]*',
+                     'lib/**/*.rb',
+                     'doc/**/*'
+                    ]
 
 desc 'Generate documentation for the acts as state machine plugin.'
-Rake::RDocTask.new(:rdoc) do |rdoc|
+rd = Rake::RDocTask.new(:rdoc) do |rdoc|
+  rdoc.rdoc_dir = 'html'
+  rdoc.template = 'doc/jamis.rb'
   rdoc.rdoc_dir = 'rdoc'
-  rdoc.title    = 'Acts As State Machine'
-  rdoc.options &lt;&lt; '--line-numbers --inline-source'
-  rdoc.rdoc_files.include('README')
-  rdoc.rdoc_files.include('TODO')
-  rdoc.rdoc_files.include('lib/**/*.rb')
+  rdoc.title    = 'AASM'
+  rdoc.options &lt;&lt; '--line-numbers' &lt;&lt; '--inline-source' &lt;&lt;  '--main' &lt;&lt; 'README' &lt;&lt; '--title' &lt;&lt; 'AASM'
+  rdoc.rdoc_files.include('README', 'MIT-LICENSE', 'TODO', 'CHANGELOG')
+  rdoc.rdoc_files.include('lib/**/*.rb', 'doc/**/*.rdoc')
 end
 
-desc &quot;Run all examples with RCov&quot;
-Spec::Rake::SpecTask.new('cruise') do |t|
-  t.spec_files = FileList['spec/*.rb']
-  t.rcov = true
-  t.rcov_opts = ['--exclude', 'spec']
+if !defined?(Gem)
+  puts &quot;Package target requires RubyGEMs&quot;
+else
+  spec = Gem::Specification.new do |s|
+    s.name = 'aasm'
+    s.version = $package_version
+    s.summary = 'State machine mixin for Ruby objects'
+    s.description = &lt;&lt;-EOF
+AASM is a continuation of the acts as state machine rails plugin, built for plain Ruby objects.
+EOF
+    s.files = PKG_FILES.to_a
+    s.require_path = 'lib'
+    s.has_rdoc = true
+    s.extra_rdoc_files = rd.rdoc_files.reject {|fn| fn =~ /\.rb$/}.to_a
+    s.rdoc_options = rd.options
+
+    s.author = 'Scott Barron'
+    s.email = 'scott@elitists.net'
+    s.homepage = 'http://rubyi.st/aasm'
+  end
+
+  package_task = Rake::GemPackageTask.new(spec) do |pkg|
+    pkg.need_zip = true
+    pkg.need_tar = true
+  end
 end
 
-desc &quot;Run all examples&quot;
-Spec::Rake::SpecTask.new('spec') do |t|
-  t.spec_files = FileList['spec/*.rb']
-  t.rcov = false
-  t.spec_opts = ['-cfs']
+if !defined?(Spec)
+  puts &quot;spec and cruise targets require RSpec&quot;
+else
+  desc &quot;Run all examples with RCov&quot;
+  Spec::Rake::SpecTask.new('cruise') do |t|
+    t.spec_files = FileList['spec/*.rb']
+    t.rcov = true
+    t.rcov_opts = ['--exclude', 'spec']
+  end
+  
+  desc &quot;Run all examples&quot;
+  Spec::Rake::SpecTask.new('spec') do |t|
+    t.spec_files = FileList['spec/*.rb']
+    t.rcov = false
+    t.spec_opts = ['-cfs']
+  end
 end
 
 task :default =&gt; [:spec]</diff>
      <filename>Rakefile</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>03780617a1589b55feacc57676127ddfc0274cdb</id>
    </parent>
  </parents>
  <author>
    <name>Scott Barron</name>
    <email>scott@elitists.net</email>
  </author>
  <url>http://github.com/eric/aasm/commit/85baeda50a11b1dae7b970b258618868d279e472</url>
  <id>85baeda50a11b1dae7b970b258618868d279e472</id>
  <committed-date>2008-02-21T08:41:56-08:00</committed-date>
  <authored-date>2008-02-21T08:41:56-08:00</authored-date>
  <message>Prepare rakefile and rake tasks for gem packaging and rdocing</message>
  <tree>e4d86deae81b0e6d5e05b0b1bfd0aa7de203ff47</tree>
  <committer>
    <name>Scott Barron</name>
    <email>scott@elitists.net</email>
  </committer>
</commit>
