Skip to content

Commit

Permalink
Change last mentions of Readline
Browse files Browse the repository at this point in the history
  • Loading branch information
abinoam committed Jan 5, 2024
1 parent 5981786 commit 6f5e977
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 21 deletions.
8 changes: 2 additions & 6 deletions lib/highline/question.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def initialize(template, answer_type)
#
attr_accessor :echo
#
# Use the Readline library to fetch input. This allows input editing as
# Use the Reline library to fetch input. This allows input editing as
# well as keeping a history. In addition, tab will auto-complete
# within an Array of choices or a file listing.
#
Expand All @@ -125,6 +125,7 @@ def initialize(template, answer_type)
# specified _input_ stream.
#
attr_accessor :readline

#
# Used to control whitespace processing for the answer to this question.
# See HighLine::Question.remove_whitespace() for acceptable settings.
Expand Down Expand Up @@ -580,11 +581,6 @@ def ask_on_error_msg
end
end

# readline() needs to handle its own output, but readline only supports
# full line reading. Therefore if question.echo is anything but true,
# the prompt will not be issued. And we have to account for that now.
# Also, JRuby-1.7's ConsoleReader.readLine() needs to be passed the prompt
# to handle line editing properly.
# @param highline [HighLine] context
# @return [void]
def show_question(highline)
Expand Down
3 changes: 2 additions & 1 deletion lib/highline/terminal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def get_line(question, highline)
# Get one line using #readline_read
# @param (see #get_line)
def get_line_with_readline(question, highline)
require "readline" # load only if needed
require "reline" # load only if needed

raw_answer = readline_read(question, highline)

Expand All @@ -117,6 +117,7 @@ def readline_read(question, highline)
end
end

# TODO: Check if this is still needed after Reline
# work-around ugly readline() warnings
old_verbose = $VERBOSE
$VERBOSE = nil
Expand Down
14 changes: 0 additions & 14 deletions test/test_reline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,6 @@ def setup
def test_readline_mode
# See #267
skip "We need vterm / yamatanooroti based tests for reline"
#
# Rubinius (and JRuby) seems to be ignoring
# Readline input and output assignments. This
# ruins testing.
#
# But it doesn't mean readline is not working
# properly on rubinius or jruby.
#

terminal = @terminal.terminal

if terminal.jruby? || terminal.rubinius? || terminal.windows?
skip "We can't test Readline on JRuby, Rubinius and Windows yet"
end

# Creating Tempfiles here because Readline.input
# and Readline.output only accepts a File object
Expand Down

0 comments on commit 6f5e977

Please sign in to comment.