mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
54baa7a463
Re-indents the eval_string, useful for amend_line and play, etc
19 lines
421 B
Ruby
19 lines
421 B
Ruby
class Pry
|
|
class Command::FixIndent < Pry::ClassCommand
|
|
match 'fix-indent'
|
|
group 'Input and Output'
|
|
|
|
description "Correct the indentation for contents of the input buffer"
|
|
|
|
banner <<-USAGE
|
|
Usage: fix-indent
|
|
USAGE
|
|
|
|
def process
|
|
indented_str = Pry::Indent.indent(eval_string)
|
|
eval_string.replace indented_str
|
|
end
|
|
end
|
|
|
|
Pry::Commands.add_command(Pry::Command::FixIndent)
|
|
end
|