Satchel
Satchel

Reputation: 16734

what is an easy way to access documentation for ruby-based gems locally?

I have a bunch of gems that I use, but am often disconnected and want to be able to pull up documentation on the gems locally.

so far, the only thing I've been able to do is actually go to the gem library and find the README.

Is there a better way that shows the readme and the full documentation locally without going to the web/github?

Upvotes: 2

Views: 449

Answers (6)

konyak
konyak

Reputation: 11736

Ref. http://guides.rubygems.org/rubygems-basics/#viewing-documentation

You can use ri [options] [names] command, e.g. ri RBTree. ri --help for more info.

or gem server command, where you can access the docs at localhost:8808

Upvotes: 0

noli
noli

Reputation: 16006

There are alot of other tools here if you don't like

gem server

http://ruby-toolbox.com/categories/gem_doc_viewers.html

Upvotes: 0

Wes
Wes

Reputation: 6595

I have the following simple shell script that allows me to browse everything offline and at my prompt:

> cat ~/bin/rim
ri -Tf ansi -w 150 $1

usage

> rim Bundler

Bundler

(from gem bundler-1.0.10)
------------------------------------------------------------------------------
Constants:

[...]

Upvotes: 0

theIV
theIV

Reputation: 25794

Have you tried gem server? I don't install RDocs, but I believe it will provide a way to browse the RDocs while offline.

Upvotes: 3

Phrogz
Phrogz

Reputation: 303520

gem server

This will launch a local web server that you can browse. If the gem includes documentation, you get it.

Upvotes: 0

Rein Henrichs
Rein Henrichs

Reputation: 15605

gem server

And some more characters.

Upvotes: 0

Related Questions