Replying to myself.  New patch.  Here is a simple backwards-compatible patch 
that allows this to work for rake 0.7.3 and rake 0.8.x

Feel free to DRY this up or otherwise make it prettier.

I tested this with on my rails app with both rake 0.7.3 and 0.8.1.

Thanks,
John

--- engines.rake.old    2007-12-29 22:54:17.000000000 -0800
+++ engines.rake        2007-12-30 20:16:10.000000000 -0800
@@ -6,14 +6,19 @@
   module Rake
     module TaskManager
       def redefine_task(task_class, args, &block)
-        task_name, deps = resolve_args(args)
+        task_name, deps = (RAKEVERSION >= '0.8.0') ? resolve_args([args]) : 
resolve_args(args)
         task_name = task_class.scope_name(@scope, task_name)
         deps = [deps] unless deps.respond_to?(:to_ary)
         deps = deps.collect {|d| d.to_s }
         task = @tasks[task_name.to_s] = task_class.new(task_name, self)
         task.application = self
-        task.add_comment(@last_comment)
-        @last_comment = nil
+        if RAKEVERSION >= '0.8.0'
+          task.add_description(@last_description)
+          @last_description = nil
+        else
+          task.add_comment(@last_comment)
+          @last_comment = nil
+        end
         task.enhance(deps, &block)
         task
       end
_______________________________________________
Engine-Developers mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org

Reply via email to