buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lac...@apache.org
Subject svn commit: r689232 - in /incubator/buildr/trunk: lib/buildr/core/application.rb spec/application_spec.rb
Date Tue, 26 Aug 2008 21:16:27 GMT
Author: lacton
Date: Tue Aug 26 14:16:27 2008
New Revision: 689232

URL: http://svn.apache.org/viewvc?rev=689232&view=rev
Log:
Made Buildr.application.buildfile tougher.  It now handles being created while in a rake namespace.
 It also handles gracefuly missing files (useful for tests).

Modified:
    incubator/buildr/trunk/lib/buildr/core/application.rb
    incubator/buildr/trunk/spec/application_spec.rb

Modified: incubator/buildr/trunk/lib/buildr/core/application.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/core/application.rb?rev=689232&r1=689231&r2=689232&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/buildr/core/application.rb (original)
+++ incubator/buildr/trunk/lib/buildr/core/application.rb Tue Aug 26 14:16:27 2008
@@ -352,10 +352,10 @@
   # This task stands for the buildfile and all its associated helper files (e.g., buildr.rb,
build.yaml).
   # By using this task as a prerequisite for other tasks, you can ensure these tasks will
be needed
   # whenever the buildfile changes.
-  class BuildfileTask < Rake::Task
+  class BuildfileTask < Rake::FileTask
     
     def timestamp
-      ([name] + prerequisites).map { |f| File.stat(f).mtime }.max
+      ([name] + prerequisites).map { |f| File.stat(f).mtime }.max rescue Time.now
     end
   end
 

Modified: incubator/buildr/trunk/spec/application_spec.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/application_spec.rb?rev=689232&r1=689231&r2=689232&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/application_spec.rb (original)
+++ incubator/buildr/trunk/spec/application_spec.rb Tue Aug 26 14:16:27 2008
@@ -328,6 +328,12 @@
       Buildr.application.buildfile.should == file(File.expand_path('buildfile'))
     end
     
+    it 'should ignore any rake namespace' do
+      namespace 'dummy_ns' do
+        Buildr.application.buildfile.should point_to_path('buildfile')
+      end
+    end
+    
     it 'should have the same timestamp as the buildfile' do
       Buildr.application.buildfile.timestamp.should be_close(@buildfile_time, 1)
     end



Mime
View raw message