2012-08-12 00:22:29 +00:00
|
|
|
class Pry
|
2012-12-25 21:35:17 +00:00
|
|
|
class Command::Bang < Pry::ClassCommand
|
|
|
|
match '!'
|
2012-08-12 01:26:59 +00:00
|
|
|
group 'Editing'
|
2012-12-25 21:35:17 +00:00
|
|
|
description 'Clear the input buffer. Useful if the parsing process goes ' \
|
|
|
|
'wrong and you get stuck in the read loop.'
|
2012-08-12 01:26:59 +00:00
|
|
|
command_options :use_prefix => false
|
|
|
|
|
2012-08-12 00:22:29 +00:00
|
|
|
def process
|
2012-12-25 21:35:17 +00:00
|
|
|
output.puts 'Input buffer cleared!'
|
|
|
|
eval_string.replace('')
|
2012-08-12 00:22:29 +00:00
|
|
|
end
|
|
|
|
end
|
2012-12-25 21:35:17 +00:00
|
|
|
|
|
|
|
Pry::Commands.add_command(Pry::Command::Bang)
|
2012-08-12 00:22:29 +00:00
|
|
|
end
|