module Ripl::Johnson::MultiLine
Public Instance Methods
before_loop()
click to toggle source
Calls superclass method
# File lib/ripl/johnson/multi_line.rb, line 2 def before_loop super @buffer = @unterminated_string = nil end
handle_interrupt()
click to toggle source
Calls superclass method
# File lib/ripl/johnson/multi_line.rb, line 38 def handle_interrupt @buffer = @unterminated_string = nil super end
loop_eval(input)
click to toggle source
Calls superclass method
# File lib/ripl/johnson/multi_line.rb, line 29 def loop_eval(input) if @buffer join = @unterminated_string ? "" : "\n" super @buffer* join + join + input else super input end end
loop_once()
click to toggle source
Calls superclass method
# File lib/ripl/johnson/multi_line.rb, line 11 def loop_once catch(:multiline) do super @buffer = nil end end
print_eval_error(e)
click to toggle source
Calls superclass method
# File lib/ripl/johnson/multi_line.rb, line 18 def print_eval_error(e) if e.is_a?(::Johnson::Error) && e.original_exception.to_s[/^SyntaxError/] @unterminated_string = e.to_s[/unterminated string literal/] @buffer ||= [] @buffer << @input throw :multiline else super end end
prompt()
click to toggle source
Calls superclass method
# File lib/ripl/johnson/multi_line.rb, line 7 def prompt @buffer ? config[:johnson_multi_line_prompt] : super end