diff --git a/lib/highline/question.rb b/lib/highline/question.rb index 8fcd68d..6d43515 100644 --- a/lib/highline/question.rb +++ b/lib/highline/question.rb @@ -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. # @@ -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. @@ -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) diff --git a/lib/highline/terminal.rb b/lib/highline/terminal.rb index 73b847e..b98a7a6 100644 --- a/lib/highline/terminal.rb +++ b/lib/highline/terminal.rb @@ -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) @@ -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 diff --git a/test/test_reline.rb b/test/test_reline.rb index 3fb8e6f..b6c6ecc 100644 --- a/test/test_reline.rb +++ b/test/test_reline.rb @@ -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