The write_out* methods all use to take multiple parameters which were
actually available without having to pass them around. Made these
parameters ivars and attr_reader'ed all of them.
Wrap command descriptions to 80 characters. Convert some string options
to symbols (where possible). Align options in code. Remove dots in the
end of switch descriptions.
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
John "banister" Mair describes the following key features of commands
as classes:
1. It enables people to extend them by either subclassing or
monkeypatching.
2. It enables them to provide their own API, so that for example, the
Pry::Command::Edit class could have class methods for people to
configure it.
Please, note that I didn't touch easter eggs commands. I also prettified
some strings (your source code reading experience should vastly improve!).
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
This simplifies the contract of Pry.config.print which makes it easier to use
in other places that we want to output a value, like ls -l.
If desired you can stil remove the => by setting Pry.config.output_prefix = ''
in your ~/.pryrc
These were coming from a pretty simple source: the DEFAULT_PRINT
prepends them so you can get output like:
[1] pry(main)> 2+3
=> 5
But since we're formatting these differently, obviously we don't want
that prefix. So this patch extracts a Pry.format_for_output method then
calls that iff the user hasn't changed the default.
There is some hackitude involved, but the test pass (and are of decent
coverage, I think, so feel fry to try to diff this down if you have a
good idea.)