You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by as...@apache.org on 2009/10/05 01:52:41 UTC

svn commit: r821642 - /buildr/trunk/lib/buildr/core/util.rb

Author: assaf
Date: Sun Oct  4 23:52:40 2009
New Revision: 821642

URL: http://svn.apache.org/viewvc?rev=821642&view=rev
Log:
Iterator hack fixed to work on both JRuby 1.3.1 and RJB on OS X.

Modified:
    buildr/trunk/lib/buildr/core/util.rb

Modified: buildr/trunk/lib/buildr/core/util.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/util.rb?rev=821642&r1=821641&r2=821642&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/util.rb (original)
+++ buildr/trunk/lib/buildr/core/util.rb Sun Oct  4 23:52:40 2009
@@ -260,7 +260,9 @@
         # and the Hash doesn't work the way we need it to.  Unfortunately, we can call toString on MRI's object,
         # but not on the JRuby one; calling to_s on the JRuby object returns what we need, but ... you guessed it.
         #  So this seems like the one hack to unite them both.
-        key = Java.java.lang.String.valueOf(keys.next)
+        #key = Java.java.lang.String.valueOf(keys.next.to_s)
+        key = keys.next
+        key = key.toString unless String === key
         hash[key] = java_properties.getProperty(key)
       end
       hash