diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-11-25 14:22:37 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-12-01 02:28:49 +0900 |
commit | d752cf7601adbe4bc2dc658effc2f61563a7dfb7 (patch) | |
tree | 7acc875d1933b330f96c7e3d7a31d61da5e77387 /tool/lib | |
parent | a0b0365e905e1ac51998ace7e6fc723406a2f157 (diff) | |
download | ruby-d752cf7601adbe4bc2dc658effc2f61563a7dfb7.tar.gz |
Use class methods of `File` over `Kernel.open` and `IO.read`
Diffstat (limited to 'tool/lib')
-rw-r--r-- | tool/lib/test/unit.rb | 2 | ||||
-rw-r--r-- | tool/lib/webrick/httputils.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tool/lib/test/unit.rb b/tool/lib/test/unit.rb index 0449fa215a..0fa7b4c5cd 100644 --- a/tool/lib/test/unit.rb +++ b/tool/lib/test/unit.rb @@ -729,7 +729,7 @@ module Test return result ensure if file = @options[:timetable_data] - open(file, 'w'){|f| + File.open(file, 'w'){|f| @records.each{|(worker, suite), (st, ed)| f.puts '[' + [worker.dump, suite.dump, st.to_f * 1_000, ed.to_f * 1_000].join(", ") + '],' } diff --git a/tool/lib/webrick/httputils.rb b/tool/lib/webrick/httputils.rb index f1b9ddf9f0..e21284ee7f 100644 --- a/tool/lib/webrick/httputils.rb +++ b/tool/lib/webrick/httputils.rb @@ -112,7 +112,7 @@ module WEBrick def load_mime_types(file) # note: +file+ may be a "| command" for now; some people may # rely on this, but currently we do not use this method by default. - open(file){ |io| + File.open(file){ |io| hash = Hash.new io.each{ |line| next if /^#/ =~ line |