Commit graph

18 commits

Author SHA1 Message Date
Stan Lo
283b2fdab4 [ruby/irb] Page ls's output (https://github.com/ruby/irb/pull/657)
* Page ls command's output

* Use Pager.page_content in show_cmds too

82d1687302
2023-07-26 08:32:02 +00:00
Stan Lo
805899dda2 [ruby/irb] Filter out top-level methods when using `ls
<Class/Module>`
(https://github.com/ruby/irb/pull/562)

Instead of always printing methods inherited from Class or Module, IRB by
default should filter them out unless `<Class/Module>` is specified to be
either of those.
2023-04-24 14:05:16 +00:00
Stan Lo
9ddd73060b [ruby/irb] Display and prioritise instance methods in `ls
<module/class>`
(https://github.com/ruby/irb/pull/496)

e3d21f9329
2023-02-28 14:36:12 +00:00
Stan Lo
3956bb859c [ruby/irb] Add "show_cmds" command to list all commands'
descriptions
(https://github.com/ruby/irb/pull/463)

7e857655ac
2022-12-08 19:10:23 +00:00
Takashi Kokubun
9a84971315 [ruby/irb] Make sure ls doesn't return an array
(https://github.com/ruby/irb/pull/461)

367797bb05
2022-11-30 04:52:33 +00:00
Takashi Kokubun
8fa83fa0b2 [ruby/irb] Transform ls's --grep/-G option to keyword args
(https://github.com/ruby/irb/pull/437)

* Transform ls's --grep/-G option to keyword args

* Make --grep less flexible

* Support -g instead of --grep

* Suppress warnings from symbol aliases
2022-11-10 22:55:15 +00:00
Stan Lo
44c1316293 [ruby/irb] Centralize coloring control (https://github.com/ruby/irb/pull/374)
* Use colorable: argument as the only coloring control

* Centalize color controling logic at Color.colorable?

There are 2 requirements for coloring output:

1. It's supported on the platform
2. The user wants it: `IRB.conf[:USE_COLORIZE] == true`

Right now we check 1 and 2 separately whenever we colorize things.
But it's error-prone because while 1 is the default of `colorable`
parameter, 2 always need to manually checked. When 2 is overlooked, it
causes issues like https://github.com/ruby/irb/pull/362

And there's 0 case where we may want to colorize even when the user
disables it. So I think we should merge 2 into `Color.colorable?` so it
can be automatically picked up.

* Add tests for all inspect modes

* Simplify inspectors' coloring logic

* Replace use_colorize? with Color.colorable?

* Remove Context#use_colorize cause it's redundant

1c53023ac4
2022-06-28 22:30:42 +09:00
Stan Lo
2d4a41df6b [ruby/irb] Commands should respect USE_COLORIZE config (https://github.com/ruby/irb/pull/362)
534688dfc4
2022-06-20 22:27:30 +09:00
Nobuyoshi Nakada
8760b270ed [ruby/irb] Move :stopdoc: directive
If this is at the top level, it stops the documentation of the
entire module, but not only the part in this file.

86c41b06ad
2022-03-14 14:40:28 +09:00
Keiko Kaneko
8ee24840c8 [ruby/irb] Update ls.rb without requiring Set, because Set is one of standard libraries
7092ad2ab5
2021-07-01 05:16:31 +09:00
Takashi Kokubun
acbddbe68c [ruby/irb] Rescue a specific error
Rescuing StandardError is prone to bugs caused by a typo or obsoleted methods.

eb5260fcd5
2021-06-30 21:06:52 +09:00
Masataka Pocke Kuwabara
e8c2b03ee1 [ruby/irb] Fix error on ls object_cant_define_singleton
such as `ls 42`, `ls :sym` and so on

b1d436a853
2021-06-30 20:55:18 +09:00
Keiko Kaneko
de779f4a62 [ruby/irb] Sort ls result ordered by anscestry
fdd5c0a71e
2021-06-22 22:32:42 +09:00
Masataka Pocke Kuwabara
de96ae9b71 [ruby/irb] Dump ancestors' methods by ls command
73edff287c
2021-05-08 14:00:40 +09:00
Takashi Kokubun
94254117ee [ruby/irb] Have some right padding
instead of filling out an entire line

6ac8f45f5f
2021-03-21 16:01:29 +09:00
Takashi Kokubun
75b38f1894 [ruby/irb] Fix step's argument
cols.size was calling Integer#size, which returns 8.

Fixing a bug of https://github.com/ruby/irb/pull/209

c93ae4be71
2021-03-21 15:50:53 +09:00
Takashi Kokubun
d0b044a842 [ruby/irb] Fix column overflow on ls output
6115754623
2021-03-21 15:19:04 +09:00
Takashi Kokubun
5f72962a09 [ruby/irb] Implement ls command
19b6c20604
2021-03-21 12:59:51 +09:00