Skip to content

Commit 95782f2

Browse files
authored
Retire magic-file.rb (#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: 3ee79e8 But now we expect files to be encoded in UTF-8 and don't specify encoding through magic comments anymore, `MagicFile` can be retired.
1 parent 813b3f2 commit 95782f2

3 files changed

Lines changed: 1 addition & 42 deletions

File tree

lib/irb/help.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
# by Keiju ISHITSUKA(keiju@ishitsuka.com)
55
#
66

7-
require_relative 'magic-file'
8-
97
module IRB
108
# Outputs the irb help message, see IRB@Command+line+options.
119
def IRB.print_usage

lib/irb/input-method.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#
66

77
require_relative 'src_encoding'
8-
require_relative 'magic-file'
98
require_relative 'completion'
109
require 'io/console'
1110
require 'reline'
@@ -132,7 +131,7 @@ def open(file, &block)
132131
# Creates a new input method object
133132
def initialize(file)
134133
super
135-
@io = file.is_a?(IO) ? file : IRB::MagicFile.open(file)
134+
@io = file.is_a?(IO) ? file : File.open(file)
136135
@external_encoding = @io.external_encoding
137136
end
138137
# The file name of this input method, usually given during initialization.

lib/irb/magic-file.rb

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)