diff options
author | Stan Lo <stan001212@gmail.com> | 2023-04-27 12:07:01 +0100 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-04-27 11:07:05 +0000 |
commit | a58cae77f77d220f44d0d16f2dbf4770ac64bd1e (patch) | |
tree | ea800e40e83bbae15497631a0f23e50b20bce222 /lib/irb | |
parent | c7bacf84f04201787d26e4a4be8aca61ff1e454b (diff) |
[ruby/irb] Stop using MagicFile for printing help messages
(https://github.com/ruby/irb/pull/573)
`MagicFile` was introduced around v0.9.6, which was like 14~15 years ago.
It was needed because back then we needed to read a file's magic comment
to determine the encoding of it, and read it with that encoding.
Commit: https://github.com/ruby/irb/commit/3ee79e89adb8e21b63d796e53bcc86281685076d
But now both EN and JA's help-message file are UTF-8 and have removed the
encoding comment, we don't need to open them with `MagicFile` anymore.
Diffstat (limited to 'lib/irb')
-rw-r--r-- | lib/irb/help.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/irb/help.rb b/lib/irb/help.rb index 7624d05dd4..a16626c7dd 100644 --- a/lib/irb/help.rb +++ b/lib/irb/help.rb @@ -12,7 +12,7 @@ module IRB lc = IRB.conf[:LC_MESSAGES] path = lc.find("irb/help-message") space_line = false - IRB::MagicFile.open(path){|f| + File.open(path){|f| f.each_line do |l| if /^\s*$/ =~ l lc.puts l unless space_line |