Skip to content

Commit

Permalink
[ruby/optparse] Use class methods of File over IO
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu authored and matzbot committed Nov 21, 2022
1 parent c9fbc77 commit e2b1546
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/optparse.rb
Expand Up @@ -1925,7 +1925,7 @@ def load(filename = nil, into: nil)
}
end
begin
parse(*IO.readlines(filename).each {|s| s.chomp!}, into: into)
parse(*File.readlines(filename, chomp: true), into: into)
true
rescue Errno::ENOENT, Errno::ENOTDIR
false
Expand Down

0 comments on commit e2b1546

Please sign in to comment.