From e9930b51b205bd4e577b3787e8d8e7db8eebc237 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Fri, 28 Apr 2023 18:20:16 +0100 Subject: [ruby/irb] Retire magic-file.rb (https://github.com/ruby/irb/pull/574) `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: 3ee79e89 But now we expect files to be encoded in UTF-8 and don't specify encoding through magic comments anymore, `MagicFile` can be retired. --- lib/irb/input-method.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/irb/input-method.rb') diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb index bc61805ebb..ed5c53c385 100644 --- a/lib/irb/input-method.rb +++ b/lib/irb/input-method.rb @@ -5,7 +5,6 @@ # require_relative 'src_encoding' -require_relative 'magic-file' require_relative 'completion' require 'io/console' require 'reline' @@ -132,7 +131,7 @@ module IRB # Creates a new input method object def initialize(file) super - @io = file.is_a?(IO) ? file : IRB::MagicFile.open(file) + @io = file.is_a?(IO) ? file : File.open(file) @external_encoding = @io.external_encoding end # The file name of this input method, usually given during initialization. -- cgit v1.2.3