2012-08-11 17:22:29 -07:00
|
|
|
class Pry
|
2012-12-25 23:35:17 +02:00
|
|
|
class Command::Bang < Pry::ClassCommand
|
2014-06-24 16:07:30 -04:00
|
|
|
match(/^\s*!\s*$/)
|
2012-08-11 18:26:59 -07:00
|
|
|
group 'Editing'
|
2013-01-09 22:23:19 +02:00
|
|
|
description 'Clear the input buffer.'
|
2018-10-13 03:09:29 +08:00
|
|
|
command_options use_prefix: false
|
2012-08-11 18:26:59 -07:00
|
|
|
|
2013-01-09 22:23:19 +02:00
|
|
|
banner <<-'BANNER'
|
|
|
|
Clear the input buffer. Useful if the parsing process goes wrong and you get
|
|
|
|
stuck in the read loop.
|
|
|
|
BANNER
|
|
|
|
|
2012-08-11 17:22:29 -07:00
|
|
|
def process
|
2012-12-25 23:35:17 +02:00
|
|
|
output.puts 'Input buffer cleared!'
|
|
|
|
eval_string.replace('')
|
2012-08-11 17:22:29 -07:00
|
|
|
end
|
|
|
|
end
|
2012-12-25 23:35:17 +02:00
|
|
|
|
|
|
|
Pry::Commands.add_command(Pry::Command::Bang)
|
2012-08-11 17:22:29 -07:00
|
|
|
end
|