diff options
author | Nobuyoshi Nakada <[email protected]> | 2022-11-21 16:20:17 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2022-11-21 22:16:49 +0900 |
commit | 612aa5c24a7c249867bbcd7d6567012aa6a7f4b9 () | |
tree | 35581bf73b35123b08cc2ac9c9f453ab0010ff69 /ext/extmk.rb | |
parent | 116920cff8739c49ba469bf243252f503e28f0fd (diff) |
Use class methods of `File` over `Kernel.open` and `IO.read`
Notes: Merged: https://.com/ruby/ruby/pull/6777
-rwxr-xr-x | ext/extmk.rb | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -144,7 +144,7 @@ def extmake(target, basedir = 'ext', maybestatic = true) d = target until (d = File.dirname(d)) == '.' if File.exist?("#{$top_srcdir}/#{basedir}/#{d}/extconf.rb") - parent = (/^all:\s*install/ =~ IO.read("#{d}/Makefile") rescue false) break end end @@ -447,9 +447,8 @@ if $extstatic end for dir in ["ext", File::join($top_srcdir, "ext")] setup = File::join(dir, CONFIG['setup']) - if File.file? setup - f = open(setup) - while line = f.gets() line.chomp! line.sub!(/#.*$/, '') next if /^\s*$/ =~ line @@ -466,7 +465,6 @@ for dir in ["ext", File::join($top_srcdir, "ext")] end MTIMES << f.mtime $setup = setup - f.close break end end unless $extstatic |