FastRI is an alternative to the ri command-line tool. It is much
also allows you to offer RI lookup services over DRb. FastRI is smarter
ri, and can find classes anywhere in the hierarchy without specifying
“full path”. FastRI can perform full-text searching. Its RubyGems
better than ri’s, and it knows which gem a method/class definition came
Additional information, tarballs… at
FastRI can be installed with RubyGems:
gem install fastri
(if you get an old version/a 404 error, please allow some time after the
release until the package propagates to the RubyForge mirrors). Please
below for an important note regarding the RubyGems packages.
- fri can do full-text search (-S, --full-text); try fri -S byte order
- fri can now determine where a method actually came from for core
e.g. fri File.inject → docs for Enumerable#inject
- you can specify which ports the DRb services must bind to:
fastri-server -s 192.168.1.2:54321
fri -s 192.168.1.2:12345
- new search methods: “anywhere” (a) and “anywhere, case-indep.” (A)
- contributed the code that allows fri to find a method in the ancestors
for core classes
There are two parts to FastRI:
- 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
and the ACL permissions are correct.
$ fastri-server (creates the index on the first run, blocks)
array.fetch(index) → obj
real 0m0.287s (real 0m0.127s with a hot cache)
real 0m10.136s (real ~ 1.5s with a hot cache)
This illustrates FastRI’s ability to locate classes deep in the class
$ fri Base
ActionMailer::Base, ActionView::Base, ActionWebService::API::Base, ActionWebService::Base, ActionWebService::Client::Base, ActiveRecord::Base, MapReduce::ActiveRecord::Base, RSS::Maker::Base, Scruffy::Components::Base, Scruffy::Formatters::Base, Scruffy::Layers::Base, Scruffy::Renderers::Base, Scruffy::Themes::Base
$ fri Themes::Base
Author: Brasten S.
Date: August 14th, 2006
$ ri Themes::Base … several seconds later …
Nothing known about Themes::Base
RubyGems adds a noticeable overhead to fri, making it run slower than if
installed it directly from the tarball with setup.rb.
Compare the execution time when installed with RubyGems:
$ time fri -f plain String > /dev/null
to the time fri actually takes to run, without the overhead introduced
$ time ruby bin/fri -f plain String > /dev/null
If you care about those extra 300ms (and there are situations where they
matter, e.g. when using fri for method completion), get FastRI from the
FastRI is licensed under the same terms as Ruby. See LICENSE.
Bug reports, patches, comments… are appreciated.
You can contact the author via [email protected]. Please add “fastri” to the
subject in order to bypass the spam filters.