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

ruby-changes:39157

From: nobu <ko1@a...>
Date: Tue, 14 Jul 2015 13:56:07 +0900 (JST)
Subject: [ruby-changes:39157] nobu:r51238 (trunk): test_filehandler.rb: fix UNC path failure

nobu	2015-07-14 13:55:13 +0900 (Tue, 14 Jul 2015)

  New Revision: 51238

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

  Log:
    test_filehandler.rb: fix UNC path failure
    
    * test/webrick/test_filehandler.rb (test_short_filename): pass
      document root path to cmd.exe instead of chdir there, as cmd.exe
      does not start on UNC path.

  Modified files:
    trunk/test/webrick/test_filehandler.rb
Index: test/webrick/test_filehandler.rb
===================================================================
--- test/webrick/test_filehandler.rb	(revision 51237)
+++ test/webrick/test_filehandler.rb	(revision 51238)
@@ -239,9 +239,12 @@ class WEBrick::TestFileHandler < Test::U https://github.com/ruby/ruby/blob/trunk/test/webrick/test_filehandler.rb#L239
     TestWEBrick.start_httpserver(config, log_tester) do |server, addr, port, log|
       http = Net::HTTP.new(addr, port)
       if windows?
-        fname = nil
-        Dir.chdir(config[:DocumentRoot]) do
-          fname = `dir /x webrick_long_filename.cgi`.match(/\s(w.+?cgi)\s/i)[1].downcase
+        root = config[:DocumentRoot].tr("/", "\\")
+        fname = IO.popen(%W[dir /x #{root}\\webrick_long_filename.cgi], &:read)
+        fname.sub!(/\A.*$^$.*$^$/m, '')
+        if fname
+          fname = fname[/\s(w.+?cgi)\s/i, 1]
+          fname.downcase!
         end
       else
         fname = "webric~1.cgi"

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

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