<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -7,14 +7,49 @@
 
 desc &quot;Open a macirb session preloaded with Git framework&quot;
 task :console do
+  # update_warning_exit unless latest_cocoagit_build(&quot;Debug-GC&quot;)
   sh &quot;./bin/macirb -rubygems -r lib/cocoagit.rb&quot;
 end
 
 desc &quot;Run test suite&quot;
 task :test do
+  # update_warning_exit unless latest_cocoagit_build(&quot;Debug-GC&quot;)
   sh &quot;bin/macruby test/suite.rb&quot;
 end
 
+def update_warning_exit
+  warning = &lt;&lt;END
+MacRuby requires a garbage-collection aware framework, and therefore
+uses the Debug-GC build of cocoagit.
+
+It appears that your Debug-GC build of Git.framework might be out of date.
+Rebuild the Debug-GC target in xcode to make sure you are using your latest changes
+END
+  puts warning
+  exit 1
+end
+
+# Not correct - can't just use the date
+def latest_cocoagit_build(target)
+  build_dir = File.join(File.dirname(__FILE__), '..', 'build')
+  projects = %w[Debug Debug-GC Release Release-GC]
+  project_dates = 
+    projects.map do |p|
+      project_file = File.join(build_dir, p, &quot;Git.framework&quot;, &quot;Git&quot;)
+      date = File.exist?(project_file) &amp;&amp; File.mtime(project_file)
+      if date
+        {:project =&gt; p, :date =&gt; date}
+      else
+        nil
+      end
+    end.compact
+  project_dates.sort! { |a, b| a[:date] &lt;=&gt; b[:date] }
+  target == project_dates.last[:project]
+end
+
+
+# MacRuby management tasks
+
 namespace :macruby do
   MACRUBY_SRC = &quot;macruby-src&quot;
   MACRUBY_LIB = File.join(MACRUBY_SRC, &quot;libmacruby.1.9.0.dylib&quot;)</diff>
      <filename>Ruby/Rakefile</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a9454a6d3dd4b357fc316321076c29fc8569879a</id>
    </parent>
  </parents>
  <author>
    <name>Brian Chapados</name>
    <email>chapados@sciencegeeks.org</email>
  </author>
  <url>http://github.com/geoffgarside/cocoagit/commit/dd78bfcd70f71e43e607895365ddc48240b497a8</url>
  <id>dd78bfcd70f71e43e607895365ddc48240b497a8</id>
  <committed-date>2008-12-24T21:52:23-08:00</committed-date>
  <authored-date>2008-12-24T21:52:23-08:00</authored-date>
  <message>Initial version of methods to check that the Debug-GC build is up-to-date.

These are currently based on the flawed assumption that _only_ the
latest build (by date) is up-to-date.  The checks are disabled until this
is fixed.</message>
  <tree>edd1b34aa11812b09df43588c98ea52003f40480</tree>
  <committer>
    <name>Brian Chapados</name>
    <email>chapados@sciencegeeks.org</email>
  </committer>
</commit>
