4

Is there a way to get at the manuals of Ruby functions from the command line?

Like the ?func man pages in R.

Aleksandr Levchuk
  • 3,751
  • 4
  • 35
  • 47

2 Answers2

4

The ri tool might help here.

ri Array  
ri Array.sort  
ri Hash#each  
ri Math::sqrt  
Matchu
  • 83,922
  • 18
  • 153
  • 160
3

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

...

Aleksandr Levchuk
  • 3,751
  • 4
  • 35
  • 47
Wes
  • 6,455
  • 3
  • 22
  • 26