You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by do...@apache.org on 2013/10/10 10:19:04 UTC

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

Author: donaldp
Date: Thu Oct 10 08:19:03 2013
New Revision: 1530874

URL: http://svn.apache.org/r1530874
Log:
Refactor the util functions java_platform? and win_os? to always return booleans

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=1530874&r1=1530873&r2=1530874&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/util.rb (original)
+++ buildr/trunk/lib/buildr/core/util.rb Thu Oct 10 08:19:03 2013
@@ -19,7 +19,7 @@ module Buildr #:nodoc:
     extend self
 
     def java_platform?
-      RUBY_PLATFORM =~ /java/
+      !!(RUBY_PLATFORM =~ /java/)
     end
 
     # In order to determine if we are running on a windows OS,
@@ -32,7 +32,7 @@ module Buildr #:nodoc:
     # For JRuby, the value for RUBY_PLATFORM will always be 'java'
     # That's why this function checks on Config::CONFIG['host_os']
     def win_os?
-      RbConfig::CONFIG['host_os'] =~ /windows|cygwin|bccwin|cygwin|djgpp|mingw|mswin|wince/i
+      !!(RbConfig::CONFIG['host_os'] =~ /windows|cygwin|bccwin|cygwin|djgpp|mingw|mswin|mswin32|wince/i)
     end
 
     # Runs Ruby with these command line arguments.  The last argument may be a hash,