ruby-changes:51702
From: k0kubun <ko1@a...>
Date: Mon, 9 Jul 2018 22:20:31 +0900 (JST)
Subject: [ruby-changes:51702] k0kubun:r63914 (trunk): file_rename.yml: allow running this on mswin/mingw
k0kubun 2018-07-09 22:20:25 +0900 (Mon, 09 Jul 2018) New Revision: 63914 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63914 Log: file_rename.yml: allow running this on mswin/mingw Suggested by MSP-Grep: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/87883 Modified files: trunk/benchmark/file_rename.yml Index: benchmark/file_rename.yml =================================================================== --- benchmark/file_rename.yml (revision 63913) +++ benchmark/file_rename.yml (revision 63914) @@ -7,9 +7,9 @@ benchmark: https://github.com/ruby/ruby/blob/trunk/benchmark/file_rename.yml#L7 max = 100_000 tmp = [ Tempfile.new('rename-a'), Tempfile.new('rename-b') ] a, b = tmp.map { |x| x.path } + tmp.each { |t| t.close } # Windows can't rename files without closing them max.times do File.rename(a, b) File.rename(b, a) end - tmp.each { |t| t.close! } loop_count: 1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/