<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>CHANGELOG</filename>
    </added>
    <added>
      <filename>README</filename>
    </added>
    <added>
      <filename>README.textile</filename>
    </added>
    <added>
      <filename>bin/garlic</filename>
    </added>
    <added>
      <filename>lib/garlic/generator.rb</filename>
    </added>
    <added>
      <filename>lib/garlic/runner.rb</filename>
    </added>
    <added>
      <filename>lib/garlic/shell.rb</filename>
    </added>
    <added>
      <filename>templates/default.rb</filename>
    </added>
    <added>
      <filename>templates/rspec.rb</filename>
    </added>
    <added>
      <filename>templates/shoulda.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -2,4 +2,4 @@
 work/*
 repos/*
 *.tmproj
-garlic-*.gem
\ No newline at end of file
+garlic-*.gem</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -9,21 +9,21 @@ $LOAD_PATH.unshift File.dirname(__FILE__) + '/lib'
 require 'garlic'
 
 spec = Gem::Specification.new do |s|
-  s.name              = &quot;garlic&quot;
-  s.version           = Garlic::Version::String
-  s.summary           = &quot;Lightweight set of rake tasks to help with CI.&quot;
-  s.description       = &quot;Lightweight set of rake tasks to help with CI.&quot;
-  s.author            = &quot;Ian White&quot;
-  s.email             = &quot;ian.w.white@gmail.com&quot;
-  s.homepage          = &quot;http://github.com/ianwhite/garlic/tree&quot;
-  s.has_rdoc          = false
-  s.test_files        = FileList[&quot;spec/**/*_spec.rb&quot;]
-  s.files             = FileList[
-    &quot;lib/**/*.rb&quot;,
-    &quot;MIT-LICENSE&quot;,
-    &quot;README.rdoc&quot;,
-    &quot;TODO&quot;
+  s.name          = &quot;garlic&quot;
+  s.version       = Garlic::Version::String
+  s.summary       = &quot;Lightweight set of rake tasks to help with CI.&quot;
+  s.description   = &quot;Lightweight set of rake tasks to help with CI.&quot;
+  s.author        = &quot;Ian White&quot;
+  s.email         = &quot;ian.w.white@gmail.com&quot;
+  s.homepage      = &quot;http://github.com/ianwhite/garlic/tree&quot;
+  s.has_rdoc      = true
+  s.rdoc_options &lt;&lt; &quot;--title&quot; &lt;&lt; &quot;Garlic&quot; &lt;&lt; &quot;--line-numbers&quot;
+  s.test_files    = FileList[&quot;spec/**/*_spec.rb&quot;]
+  s.files         = FileList[
+    &quot;lib/**/*.rb&quot;, &quot;templates/*.rb&quot;,
+    &quot;MIT-LICENSE&quot;, &quot;README.textile&quot;, &quot;TODO&quot;, &quot;CHANGELOG&quot;
   ]
+  s.executables   = [&quot;garlic&quot;]
 end
 
 Rake::GemPackageTask.new(spec) do |p|</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,2 +1 @@
-* Make garlic a gem - and remove the need to clone the garlic repo each time
 * rewrite using grit? (research: is grit the defacto standard for ruby controlling git?)
\ No newline at end of file</diff>
      <filename>TODO</filename>
    </modified>
    <modified>
      <diff>@@ -1,18 +1,16 @@
-# -*- encoding: utf-8 -*-
-
 Gem::Specification.new do |s|
   s.name = %q{garlic}
-  s.version = &quot;0.1.1&quot;
+  s.version = &quot;0.1.2&quot;
 
   s.required_rubygems_version = Gem::Requirement.new(&quot;&gt;= 0&quot;) if s.respond_to? :required_rubygems_version=
   s.authors = [&quot;Ian White&quot;]
-  s.date = %q{2008-10-11}
+  s.date = %q{2008-10-30}
   s.description = %q{Lightweight set of rake tasks to help with CI.}
   s.email = %q{ian.w.white@gmail.com}
-  s.files = [&quot;lib/garlic/configurator.rb&quot;, &quot;lib/garlic/garlic.rb&quot;, &quot;lib/garlic/repo.rb&quot;, &quot;lib/garlic/target.rb&quot;, &quot;lib/garlic/tasks.rb&quot;, &quot;lib/garlic.rb&quot;, &quot;MIT-LICENSE&quot;, &quot;README.rdoc&quot;, &quot;TODO&quot;, &quot;spec/garlic/repo_spec.rb&quot;]
+  s.files = [&quot;lib/garlic/configurator.rb&quot;, &quot;lib/garlic/repo.rb&quot;, &quot;lib/garlic/session.rb&quot;, &quot;lib/garlic/target.rb&quot;, &quot;lib/garlic/tasks.rb&quot;, &quot;lib/garlic.rb&quot;, &quot;MIT-LICENSE&quot;, &quot;README.textile&quot;, &quot;TODO&quot;, &quot;CHANGELOG&quot;, &quot;spec/garlic/repo_spec.rb&quot;]
   s.homepage = %q{http://github.com/ianwhite/garlic/tree}
   s.require_paths = [&quot;lib&quot;]
-  s.rubygems_version = %q{1.3.0}
+  s.rubygems_version = %q{1.2.0}
   s.summary = %q{Lightweight set of rake tasks to help with CI.}
   s.test_files = [&quot;spec/garlic/repo_spec.rb&quot;]
 
@@ -20,7 +18,7 @@ Gem::Specification.new do |s|
     current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
     s.specification_version = 2
 
-    if Gem::Version.new(Gem::RubyGemsVersion) &gt;= Gem::Version.new('1.2.0') then
+    if current_version &gt;= 3 then
     else
     end
   else</diff>
      <filename>garlic.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -1,14 +1,37 @@
-require &quot;garlic/garlic&quot;
+require &quot;garlic/runner&quot;
 require &quot;garlic/configurator&quot;
 require &quot;garlic/repo&quot;
 require &quot;garlic/target&quot;
+require &quot;garlic/generator&quot;
+require &quot;garlic/shell&quot;
 
 module Garlic
+  include Generator
+  
   module Version
     Major = 0
     Minor = 1
-    Tiny  = 1
+    Tiny  = 2
     
     String = [Major, Minor, Tiny].join('.')
   end
+  
+  # return the current garlic runner
+  def garlic(config = nil, &amp;block)
+    @garlic ||= Garlic::Runner.new(self)
+    load_config(config)
+    @garlic.configure(&amp;block) if block_given?
+    @garlic
+  end
+  
+  # load config from 
+  def load_config(config = nil)
+    unless @garlic_config_file
+      @garlic_config_file = config || &quot;garlic.rb&quot;
+      unless File.exists?(@garlic_config_file)
+        raise &quot;garlic requries a configuration file (can't find #{@garlic_config_file}), try:\n  garlic generate [#{available_templates.join('|')}] &gt; garlic.rb&quot;
+      end
+      eval File.read(@garlic_config_file)
+    end
+  end
 end
\ No newline at end of file</diff>
      <filename>lib/garlic.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 module Garlic
+  # Configures the garlic runner in a decalarative style
   class Configurator
     attr_reader :garlic
 
@@ -7,14 +8,6 @@ module Garlic
       instance_eval(&amp;block) if block_given?
     end
 
-    def work_path(path)
-      garlic.work_path = path
-    end
-
-    def repo_path(path)
-      garlic.repo_path = path
-    end
-
     def repo(name, options = {})
       options[:name] = name
       options[:path] ||= &quot;#{garlic.repo_path}/#{name}&quot;
@@ -33,6 +26,19 @@ module Garlic
       garlic.targets &lt;&lt; Target.new(garlic, options)
     end
 
+    def respond_to?(method)
+      super || garlic.respond_to?(&quot;#{method}=&quot;)
+    end
+    
+  protected
+    def method_missing(attribute, value)
+      if garlic.respond_to?(&quot;#{attribute}=&quot;)
+        garlic.send(&quot;#{attribute}=&quot;, value)
+      else
+        super
+      end
+    end
+  
     class BlockParser
       attr_reader :options, :whitelist
 </diff>
      <filename>lib/garlic/configurator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,5 @@
+require 'shell'
+
 module Garlic
   class Target
     attr_reader :garlic, :path, :name, :rails_repo_name, :tree_ish
@@ -20,7 +22,7 @@ module Garlic
       runner.run(&amp;@prepare) if @prepare
     end
     
-    def run
+    def run(command = nil)
       runner.run(&amp;garlic.all_targets[:run]) if garlic.all_targets[:run]
       runner.run(&amp;@run) if @run
     end
@@ -29,9 +31,18 @@ module Garlic
       read_sha('vendor/rails')
     end
     
+    def shell
+      unless @shell
+        @shell = Shell.new
+        @shell.verbose = false
+        @shell.cd path
+      end
+      @shell
+    end
+    
   private
     def runner
-      @runner ||= Runner.new(self)
+      @runner ||= Target::Runner.new(self)
     end
     
     def read_sha(install_path)</diff>
      <filename>lib/garlic/target.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,51 +1,23 @@
-$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))
-require &quot;garlic&quot;
+require File.expand_path(File.join(File.dirname(__FILE__), '..', 'garlic'))
 
-def garlic(&amp;block)
-  @garlic ||= Garlic::Garlic.new(self)
-  @garlic.configure(&amp;block) if block_given?
-  @garlic
+include Garlic
+
+# configure the garlic runner
+garlic ENV['CONFIG'] do
+  verbose ['true', 'yes', '1'].include?(ENV['VERBOSE'])
+  run_targets ENV['TARGETS'] || ENV['TARGET']
 end
 
-desc &quot;Prepare and run specified TARGET(S) (default all)&quot;
-task :garlic =&gt; ['garlic:prepare_targets', 'garlic:run_targets']
+desc &quot;Run garlic:default (CONFIG=path, TARGETS=list, VERBOSE=true)&quot;
+task :garlic do
+  garlic.default
+end
 
 namespace :garlic do
-  desc &quot;Install repos, update repos, check repos, prepare targets, and run CI in them&quot;
-  task :all =&gt; [:install_repos, :update_repos, :check_repos, :prepare_targets, :run_targets]
-  
-  desc &quot;Prepare specified TARGET(S) (default all)&quot;
-  task :prepare_targets do
-    garlic.prepare
-  end
-  
-  desc &quot;Clean all of the work away, but not the repos&quot;
-  task :clean do
-    garlic.clean
-  end
-
-  desc &quot;Run the CI 'run' task in specified TARGET(S) (default all)&quot;
-  task :run_targets do
-    garlic.run
-  end
-  
-  desc &quot;Install required repositories&quot;
-  task :install_repos do
-    garlic.install_repos
-  end
-
-  desc &quot;Update installed repositories&quot;
-  task :update_repos do
-    garlic.update_repos
-  end
-
-  desc &quot;Check that repositories are installed&quot;
-  task :check_repos do
-    garlic.check_repos
-  end
-  
-  desc &quot;Reset all repos back to master&quot;
-  task :reset_repos do
-    garlic.reset_repos
+  Garlic::Runner.commands_with_description.each do |command, description|
+    desc description
+    task command do
+      garlic.send command
+    end
   end
 end
\ No newline at end of file</diff>
      <filename>lib/garlic/tasks.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>README.rdoc</filename>
    </removed>
    <removed>
      <filename>lib/garlic/garlic.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>09af25f8d0b7cabb789a6875f29d1528cdc10ee8</id>
    </parent>
  </parents>
  <author>
    <name>Ian White</name>
    <email>ian.w.white@gmail.com</email>
  </author>
  <url>http://github.com/ianwhite/garlic/commit/ea4d8e6512d2fc40adb8e64057553e8f20586c59</url>
  <id>ea4d8e6512d2fc40adb8e64057553e8f20586c59</id>
  <committed-date>2008-11-01T03:17:11-07:00</committed-date>
  <authored-date>2008-11-01T03:17:11-07:00</authored-date>
  <message>0.1.2 - garlic now works as a command line tool</message>
  <tree>2796360f88b33d3b7c5e28201488b1c41ddf3c8c</tree>
  <committer>
    <name>Ian White</name>
    <email>ian.w.white@gmail.com</email>
  </committer>
</commit>
