Manual pages for command line Ruby functions

Is there a way to get a guide to Ruby functions from the command line?

Like the ?func man pages in R.

+4
source share
2 answers

The ri tool can help here.

 ri Array ri Array.sort ri Hash#each ri Math::sqrt 
+4
source

I have the following shell script that I use because it does color formatting in the terminal:

 wesbailey@feynman :~/insiderpages> cat `which rim` ri -Tf ansi -w 150 $1 wesbailey@feynman :~/insiderpages> rim Array 

...

+3
source

Source: https://habr.com/ru/post/1342899/


All Articles