summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-11-21 16:20:17 +0900
committergit <svn-admin@ruby-lang.org>2022-11-21 13:15:48 +0000
commit116920cff8739c49ba469bf243252f503e28f0fd (patch)
tree0b992a14159515b2570038f0f103922b5b415c48 /lib
parente2b15461a7dc645f4562e1d1a3f0f89973794258 (diff)
[ruby/un] Use class methods of `File` over `Kernel.open`
https://github.com/ruby/un/commit/13bdd766fe
Diffstat (limited to 'lib')
-rw-r--r--lib/un.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/un.rb b/lib/un.rb
index 9242357215..535a077bd6 100644
--- a/lib/un.rb
+++ b/lib/un.rb
@@ -256,7 +256,7 @@ def wait_writable
wait = (wait = options[:w]) ? Float(wait) : 0.2
argv.each do |file|
begin
- open(file, "r+b")
+ File.open(file, "r+b")
rescue Errno::ENOENT
break
rescue Errno::EACCES => e
@@ -422,7 +422,7 @@ module UN # :nodoc:
messages = {}
store = proc {|msg| messages[cmd] = msg}
end
- open(__FILE__) do |me|
+ File.open(__FILE__) do |me|
while me.gets("##\n")
if help = me.gets("\n\n")
if all or argv.include?(cmd = help[/^#\s*ruby\s.*-e\s+(\w+)/, 1])