File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,11 @@ def filename_quote_characters=(v)
114
114
end
115
115
116
116
def special_prefixes = ( v )
117
- @special_prefixes = v . encode ( encoding )
117
+ if v . nil?
118
+ @special_prefixes = ''
119
+ else
120
+ @special_prefixes = v . encode ( encoding )
121
+ end
118
122
end
119
123
120
124
def completion_case_fold = ( v )
@@ -174,14 +178,25 @@ def dialog_proc(name_sym)
174
178
end
175
179
176
180
def input = ( val )
177
- raise TypeError unless val . respond_to? ( :getc ) or val . nil?
181
+ raise TypeError unless val . respond_to? ( :getc )
178
182
if val . respond_to? ( :getc ) && io_gate . respond_to? ( :input= )
179
183
io_gate . input = val
184
+ elsif val . nil?
185
+ io_gate . input = STDIN
186
+ return
187
+ else
188
+ # noop
189
+ # Reline::Windows does not suppport input= method
180
190
end
181
191
end
182
192
183
193
def output = ( val )
184
- raise TypeError unless val . respond_to? ( :write ) or val . nil?
194
+ if val . nil?
195
+ val = STDOUT
196
+ elsif !val . respond_to? ( :write )
197
+ raise TypeError
198
+ end
199
+
185
200
@output = val
186
201
io_gate . output = val
187
202
end
You can’t perform that action at this time.
0 commit comments