FastRI: faster, smarter RI docs for Ruby, DRb-enabled

Overview

FastRI is an alternative to the "ri" documentation browser for Ruby.
As of 0.3.0, FastRI can operate in standalone mode (without using a DRb
server, see below), so it can now fully replace ri for most intents and
purposes.

Why prefer it over ri? FastRI

actually works

is *much* faster than ri

can perform fast full-text searching over all your rdoc documentation

is smarter than ri, and can find classes anywhere in the hierarchy without specifying the "full path"

can be told to use different search strategies (completion, nested namespaces, etc.)

supports RubyGems much better than ri, and knows which gem a method/class came from

Usage

Starting from 0.3.0, fri can be used in either local mode (--local, -L) or
remote mode (using a fastri-server, -R, --remote).
By default, fri will run in remote mode. There's a new executable named
qri that defaults to local mode (it behaves otherwise identically to fri).

Remote mode is slightly faster (typically about 150ms) , since the
documentation index is kept in memory and needs not be read from disk.

Local mode

$ qri Array
----------------------------------------------------------- Class: Array
Arrays are ordered, integer-indexed collections of any object.
Array indexing starts at 0, as in C or Java. A negative index is
...

Remote mode

There are two parts to using FastRI in remote mode:

the server: fastri-server

the client: fri

FastRI uses a Rinda Ring to allow servers to be discovered automatically
without needing to indicate the DRb URIs manually. It can work across
machines if you make sure the ring server is bound to the correct interface,
and the ACL permissions are correct.

Quickstart

First of all, the DRb server must be launched with

$ fastri-server (blocks)

Later,

$ fri String
---------------------------------------------------------- Class: String
A String object holds and manipulates an arbitrary sequence of
bytes, typically representing characters. String objects may be
created using String::new or as literals.
...

Read on for more information, including how to make FastRI work across
machines.

More about fastri-server

For local usage, just

$ fastri-server

will do. The DRb service will bind to 127.0.0.1, and only connections from
127.0.0.1 will be allowed. If you want to allow fri to be used from other
machines, you have to specify which interface to bind to, and allow incoming
connections from the desired hosts. For example, if your network is
192.168.1.0, and your IP is 192.168.1.2, you can do

If you're on a different machine, you'll probably have to specify which
address the DRb service should be attached to. You can either specify it with
-s ADDRESS (or --bind ADDRESS), or set the FASTRI_ADDR environment variable.
For example, if you're on 192.168.1.101, both

export FASTRI_ADDR="192.168.1.101"
fri Array

and

fri -s 192.168.1.101 Array

will work. Note that FASTRI_ADDR is the *local* address: the server will be
discovered automatically. (The reason why the local address must be specified
is that it will be given to the ring server, which must be able to establish
a reverse connection through the local DRb service.)

Feedback

Bug reports, patches, comments... are appreciated.
You can contact the author via <mfp@acm.org>. Please add "fastri" to the
subject in order to bypass the spam filters.