ruby-changes:33472
From: naruse <ko1@a...>
Date: Thu, 10 Apr 2014 16:39:48 +0900 (JST)
Subject: [ruby-changes:33472] naruse:r45551 (trunk): explicitly specify ::File
naruse 2014-04-10 16:39:44 +0900 (Thu, 10 Apr 2014) New Revision: 45551 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45551 Log: explicitly specify ::File There's Bug::File in test/-ext-/file/test_stat.rb. It prevent constan search with `File`. Modified files: trunk/test/-ext-/win32/test_dln.rb Index: test/-ext-/win32/test_dln.rb =================================================================== --- test/-ext-/win32/test_dln.rb (revision 45550) +++ test/-ext-/win32/test_dln.rb (revision 45551) @@ -14,18 +14,18 @@ module Bug https://github.com/ruby/ruby/blob/trunk/test/-ext-/win32/test_dln.rb#L14 def test_nonascii_load bug9699 = '[ruby-core:61845] [Bug #9699]' so = "-test-/win32/dln/empty." + RbConfig::CONFIG["DLEXT"] - so = $:.find {|d| d = File.join(d, so); break d if File.exist?(d)} + so = $:.find {|d| d = ::File.join(d, so); break d if ::File.exist?(d)} assert_not_nil(so) - Dir.mkdir(dir = File.join(testdir = Dir.mktmpdir("test"), "\u{30c6 30b9 30c8}")) - File.copy_stream(so, File.join(dir, File.basename(so))) - assert_separately(['-', bug9699, testdir, File.basename(so)], <<-'end;') + Dir.mkdir(dir = ::File.join(testdir = Dir.mktmpdir("test"), "\u{30c6 30b9 30c8}")) + ::File.copy_stream(so, ::File.join(dir, ::File.basename(so))) + assert_separately(['-', bug9699, testdir, ::File.basename(so)], <<-'end;') bug, dir, so = *ARGV assert_nothing_raised(LoadError, bug) do - require File.join(dir, "\u{30c6 30b9 30c8}", so) + require ::File.join(dir, "\u{30c6 30b9 30c8}", so) end end; ensure - File.unlink(File.join(dir, File.basename(so))) rescue nil + ::File.unlink(::File.join(dir, ::File.basename(so))) rescue nil Dir.rmdir(dir) rescue nil Dir.rmdir(testdir) rescue nil end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/