1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00
Commit graph

25 commits

Author SHA1 Message Date
Andrew Vos
2c4c784a82 refactor raise_errors_if_arguments_are_weird as per @rking advice 2013-01-12 17:59:11 -06:00
Andrew Vos
0dfdf7bd56 readability in write_out methods
thanks to @locks for this one
2013-01-12 17:59:11 -06:00
Andrew Vos
3e8c7031f6 don't use unneccessary meta-programming 2013-01-12 17:59:11 -06:00
Andrew Vos
cc4df826ff stop passing so many parameters around
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.
2013-01-12 17:59:11 -06:00
Andrew Vos
96bca02a76 refactor the #process method
This has created a whole lot of additional methods. Perhaps these should
be moved into some sort of Presenter (puke) classes.
2013-01-12 17:59:11 -06:00
Andrew Vos
17d485b224 refactor #process 2013-01-12 17:59:11 -06:00
Kyrylo Silin
1c33a73964 Add headings for methods in the output of ls
You will see headings when a table has more than 35 methods.
Otherwise, there is no need in them.
2013-01-13 00:12:53 +02:00
☈king
139a2a7a0a Extract Table to its own file 2013-01-09 17:18:44 -06:00
Kyrylo Silin
256f35422a Prettify command descriptions, switches and stuff
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>
2013-01-09 22:23:19 +02:00
☈king
f9b9598c11 ls columns improvement
Now is like /bin/ls, sorting downward, shrink-wrapping columns, and
minimizing row usage as best as I know how.
2013-01-08 14:22:20 -06:00
☈king
4e89649ac7 Intermediate merge step 2013-01-08 14:22:20 -06:00
Kyrylo Silin
ebccd57013 Convert all commands to classes
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>
2012-12-27 13:31:37 +02:00
Andrew Vos
d65e5c8901 page output of ls command 2012-12-07 19:55:27 +01:00
Conrad Irwin
e19d21b8ee Make "ls" command work even when TerminalInfo doesn't 2012-11-29 10:23:54 -08:00
Conrad Irwin
bd9804cb0e Handle case where maximum_width > screen_width 2012-11-29 09:59:02 -08:00
Conrad Irwin
ccc2177f12 Add missing brackets to function definitions 2012-11-29 09:51:10 -08:00
Andrew Vos
5076aa5769 take into account string that have ansi codes 2012-11-29 12:03:34 +00:00
Andrew Vos
cd5f0ae3be Reading the output of ls is hard, tablify it
ls now shows items more like how the unix ls works
2012-11-29 10:51:08 +00:00
Conrad Irwin
5246700e2b Move hashrocket out of Pry.config.print
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
2012-11-08 00:02:25 -08:00
☈king
54f8243efa Rename to output_with_default_format 2012-11-05 01:30:45 -06:00
☈king
95fbab218d Non-MRI1.9 local_variables return Strings (dumb.) 2012-11-05 00:12:48 -06:00
☈king
2195ada664 Eliminate spurious hashrockets.
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.)
2012-11-04 22:34:43 -06:00
☈king
e062a00837 Use ls -l instead of new command. 2012-11-04 22:34:17 -06:00
Ryan Fitzgerald
1af4207c63 Restore groups, convert most commands to class syntax 2012-08-11 18:27:26 -07:00
Ryan Fitzgerald
8ce49ee081 Remove extended_commands, default_commands -> commands 2012-08-11 17:39:25 -07:00
Renamed from lib/pry/default_commands/ls.rb (Browse further)