Author: assaf
Date: Sun Oct 4 23:26:21 2009
New Revision: 821640
URL: http://svn.apache.org/viewvc?rev=821640&view=rev
Log:
Under Ruby 1.8.x selecting from a Hash returns an Array. 1.9.1 fixes that and
returns a Hash, to work on both, converting Hash to Array.
Modified:
buildr/trunk/lib/buildr/core/compile.rb
Modified: buildr/trunk/lib/buildr/core/compile.rb
URL:
http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/compile.rb?rev=821640&r1=821639&r2=821640&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/compile.rb (original)
+++ buildr/trunk/lib/buildr/core/compile.rb Sun Oct 4 23:26:21 2009
@@ -122,7 +122,7 @@
map = compile_map(sources, target)
return false if map.empty?
return true unless File.exist?(target.to_s)
- source_files_not_yet_compiled = map.select { |source, target|
!File.exist?(target) }
+ source_files_not_yet_compiled = map.select { |source, target|
!File.exist?(target) }.to_a
trace "Compile needed because source file
#{source_files_not_yet_compiled[0][0]} has no corresponding
#{source_files_not_yet_compiled[0][1]}" unless
source_files_not_yet_compiled.empty?
return true if map.any? { |source, target| !File.exist?(target) ||
File.stat(source).mtime > File.stat(target).mtime }
oldest = map.map { |source, target| File.stat(target).mtime }.min