|
9 | 9 | require 'reline' |
10 | 10 |
|
11 | 11 | module IRB |
12 | | - STDIN_FILE_NAME = "(line)" # :nodoc: |
13 | 12 | class InputMethod |
14 | | - |
15 | | - # Creates a new input method object |
16 | | - def initialize(file = STDIN_FILE_NAME) |
17 | | - @file_name = file |
18 | | - end |
19 | | - # The file name of this input method, usually given during initialization. |
20 | | - attr_reader :file_name |
21 | | - |
22 | 13 | # The irb prompt associated with this input method |
23 | 14 | attr_accessor :prompt |
24 | 15 |
|
@@ -59,7 +50,6 @@ def inspect |
59 | 50 | class StdioInputMethod < InputMethod |
60 | 51 | # Creates a new input method object |
61 | 52 | def initialize |
62 | | - super |
63 | 53 | @line_no = 0 |
64 | 54 | @line = [] |
65 | 55 | @stdin = IO.open(STDIN.to_i, :external_encoding => IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => "-") |
@@ -133,12 +123,9 @@ def open(file, &block) |
133 | 123 |
|
134 | 124 | # Creates a new input method object |
135 | 125 | def initialize(file) |
136 | | - super |
137 | 126 | @io = file.is_a?(IO) ? file : File.open(file) |
138 | 127 | @external_encoding = @io.external_encoding |
139 | 128 | end |
140 | | - # The file name of this input method, usually given during initialization. |
141 | | - attr_reader :file_name |
142 | 129 |
|
143 | 130 | # Whether the end of this input method has been reached, returns +true+ if |
144 | 131 | # there is no more data to read. |
@@ -186,7 +173,6 @@ def initialize |
186 | 173 | if Readline.respond_to?(:encoding_system_needs) |
187 | 174 | IRB.__send__(:set_encoding, Readline.encoding_system_needs.name, override: false) |
188 | 175 | end |
189 | | - super |
190 | 176 |
|
191 | 177 | @line_no = 0 |
192 | 178 | @line = [] |
@@ -267,7 +253,6 @@ class RelineInputMethod < InputMethod |
267 | 253 | # Creates a new input method object using Reline |
268 | 254 | def initialize |
269 | 255 | IRB.__send__(:set_encoding, Reline.encoding_system_needs.name, override: false) |
270 | | - super |
271 | 256 |
|
272 | 257 | @line_no = 0 |
273 | 258 | @line = [] |
|
0 commit comments