ruby-changes:56901
From: Nobuyoshi <ko1@a...>
Date: Sat, 10 Aug 2019 11:26:46 +0900 (JST)
Subject: [ruby-changes:56901] Nobuyoshi Nakada: 07e42e88d9 (master): Close created files [ci skip]
https://git.ruby-lang.org/ruby.git/commit/?id=07e42e88d9 From 07e42e88d9f2b7756dde0a2377990ebf3c5e1973 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sat, 10 Aug 2019 11:26:23 +0900 Subject: Close created files [ci skip] diff --git a/benchmark/require.yml b/benchmark/require.yml index 711d8e1..09f218c 100644 --- a/benchmark/require.yml +++ b/benchmark/require.yml @@ -15,11 +15,7 @@ prelude: | https://github.com/ruby/ruby/blob/trunk/benchmark/require.yml#L15 FileUtils.mkdir_p(data_dir) 1.upto(num_files) do |i| - f = File.open("#{data_dir}/c#{i}.rb", "w") - f.puts <<-END - class C#{i} - end - END + File.write("#{data_dir}/c#{i}.rb", "class C#{i}\n""end\n") end end diff --git a/benchmark/require_thread.yml b/benchmark/require_thread.yml index 87e0ba8..0c63257 100644 --- a/benchmark/require_thread.yml +++ b/benchmark/require_thread.yml @@ -15,11 +15,7 @@ prelude: | https://github.com/ruby/ruby/blob/trunk/benchmark/require_thread.yml#L15 FileUtils.mkdir_p(data_dir) 1.upto(num_files) do |i| - f = File.open("#{data_dir}/c#{i}.rb", "w") - f.puts <<-END - class C#{i} - end - END + File.write("#{data_dir}/c#{i}.rb", "class C#{i}\n""end\n") end end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/