[前][次][番号順一覧][スレッド一覧]

ruby-changes:32277

From: nobu <ko1@a...>
Date: Mon, 23 Dec 2013 15:52:43 +0900 (JST)
Subject: [ruby-changes:32277] nobu:r44356 (trunk): envutil.rb: use EXEEXT

nobu	2013-12-23 15:52:35 +0900 (Mon, 23 Dec 2013)

  New Revision: 44356

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44356

  Log:
    envutil.rb: use EXEEXT
    
    * test/ruby/envutil.rb (rubybin): use EXEEXT configured value
      instead of the hard coded suffix.

  Modified files:
    trunk/test/ruby/envutil.rb
Index: test/ruby/envutil.rb
===================================================================
--- test/ruby/envutil.rb	(revision 44355)
+++ test/ruby/envutil.rb	(revision 44356)
@@ -9,12 +9,13 @@ module EnvUtil https://github.com/ruby/ruby/blob/trunk/test/ruby/envutil.rb#L9
       return ruby
     end
     ruby = "ruby"
-    rubyexe = ruby+".exe"
+    exeext = RbConfig::CONFIG["EXEEXT"]
+    rubyexe = (ruby + exeext if exeext and !exeext.empty?)
     3.times do
       if File.exist? ruby and File.executable? ruby and !File.directory? ruby
         return File.expand_path(ruby)
       end
-      if File.exist? rubyexe and File.executable? rubyexe
+      if rubyexe and File.exist? rubyexe and File.executable? rubyexe
         return File.expand_path(rubyexe)
       end
       ruby = File.join("..", ruby)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]