<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -4,6 +4,27 @@ require 'rubygems'
 require 'yaml'
 require 'pp'
 
+require 'optparse'
+
+options = {}
+OptionParser.new do |opts|
+  opts.banner = &quot;Usage: example.rb [options]&quot;
+
+  opts.on(&quot;-g [NAME]&quot;, &quot;--ginger [NAME]&quot;, &quot;Ginger gem name&quot;) do |name|
+    options[:ginger] = name
+  end
+
+  opts.on(&quot;-n [NAME]&quot;, &quot;--notamock [NAME]&quot;, &quot;Not A Mock gem name&quot;) do |name|
+    options[:notamock] = name
+  end
+
+  opts.on(&quot;-s [NAME]&quot;, &quot;--sphinx [NAME]&quot;, &quot;Sphinx daemon name&quot;) do |name|
+    options[:sphinx] = name
+  end
+end.parse!
+
+OPTIONS = options
+
 module ContributeHelper; end
 
 class Contribute
@@ -14,7 +35,8 @@ class Contribute
       Dependencies::Sphinx,
       Dependencies::Mysql,
       Dependencies::AR,
-      Dependencies::Ginger
+      Dependencies::Ginger,
+      Dependencies::NotAMock
     ]
   end
 
@@ -159,6 +181,8 @@ EO_CREATE_DATABASE_FAILED
     begin
       ActiveRecord::Base.connection.create_database('thinking_sphinx')
       colour_puts &quot;&lt;green&gt;successful&lt;/green&gt;&quot;
+      puts
+      return true
     rescue ActiveRecord::StatementInvalid
       if $!.message[/database exists/]
         colour_puts &quot;&lt;green&gt;successful&lt;/green&gt; (database already existed)&quot;
@@ -166,11 +190,10 @@ EO_CREATE_DATABASE_FAILED
         return true
       else
         colour_puts &quot;&lt;red&gt;failed&lt;/red&gt;&quot;
+		    colour_puts CREATE_DATABASE_FAILED
       end
     end
     
-    colour_puts CREATE_DATABASE_FAILED
-    
     false
   end
   
@@ -272,6 +295,11 @@ module ContributeHelper
     
     puts
     
+    if !all_found
+	    print &quot;You may wish to try setting additional options. Use ./contribute.rb -h for details&quot;
+	    puts
+	  end
+    
     all_found
   end
   
@@ -315,18 +343,23 @@ module Dependencies
   end
   
   class Ginger &lt; ContributeHelper::Gem
-    name 'ginger'
+    name(OPTIONS.has_key?(:ginger) ? OPTIONS[:ginger] : 'ginger')
+  end
+  
+  class NotAMock &lt; ContributeHelper::Gem
+    name(OPTIONS.has_key?(:notamock) ? OPTIONS[:notamock] : 'not_a_mock')
   end
   
   class Sphinx &lt; ContributeHelper::Dependency
     name 'sphinx'
     
     def check
-      output = `which searchd`
+		  app_name = OPTIONS.has_key?(:sphinx) ? OPTIONS[:sphinx] : 'searchd'
+      output = `which #{app_name}`
       @location = output.chomp if $? == 0
       $? == 0
     end
   end
 end
 
-Contribute.new.show
\ No newline at end of file
+Contribute.new.show</diff>
      <filename>contribute.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>80e59b2d9e371ff959b212a168b2d1349aa57df7</id>
    </parent>
  </parents>
  <author>
    <name>Tom Simnett</name>
    <email>tom@initforthe.com</email>
  </author>
  <url>http://github.com/freelancing-god/thinking-sphinx/commit/cde7e4966213ec30eac3422504e76b3ea7a2bb27</url>
  <id>cde7e4966213ec30eac3422504e76b3ea7a2bb27</id>
  <committed-date>2009-06-15T20:20:14-07:00</committed-date>
  <authored-date>2009-06-15T06:03:14-07:00</authored-date>
  <message>Update of contribute.rb to allow different gem names and fixed up database connection tests</message>
  <tree>307ddb857a5fc08fdbf2917882ff592a857456a9</tree>
  <committer>
    <name>Pat Allan</name>
    <email>pat@freelancing-gods.com</email>
  </committer>
</commit>
