WebRI

Information

Method Index [+]

Quicksearch
[Validate]
Generated with WebRI RedFish 1.2

WebRI

DESCRIPTION

WebRI is both a dynamic web-based ri-browser which can provided ri documentation dynamically, by running a webrick server, and a superalatvie Ruby documentation generator with a variety of built in templates.

FEATURES

LIMITATIONS

Please note that the ri web server and the generation system were developed separately, and are not well integrated. For this reason (at the very least) the ri server cannot use the templates available to the generators. If possible, a future version will allow this.

USAGE SYNOPSIS

Generate Documentation

WebRI provides a webri executable you can use to generate documentation. The interface is identical to rdoc. Use the -T option to specify a template type.

  $ webri -T redfish README lib/

You can use rdoc command if you prefer (though in far off future versions this may not be the case).

  $ rdoc -T redfish README lib/

WebRI extend RIDoc to recognize the templates that WebRI will handle and transfers control to appropriate WebRI generator accordingly.

Using the Web Server

WebRI can be used as a dynamic ri browser, either for a single project or for a collection of libraries. Indeed, the WebRI server can be used to browse the entire installed object system —eveything documented in your central install locations. To do the later, simply execute webri-server with no arguments and open a webrowser to the local port designated (see below).

  $ webr-server

To browse per-project ri documentation, you will first need to locate the project’s ri files, either by locating them in your system installation or by generating them for a project, which can be done using rdoc, eg.

  $ rdoc --ri --op "doc/ri" lib/

Sometimes a package will include a convenience script for generating these. Try running ‘rake -T’, or look for a ‘script/’ or ‘task/’ executable that does the job. Usually the generated documentation is placed in either ri/ or doc/ri/. I will use doc/ri/ in the following example, adjust your directory as needed.

With ri files loacted you can view them with:

  $ webri-server doc/ri

You will see a Webrick server start up, informing you of the port being used.

  [2008-03-28 12:11:16] INFO  WEBrick 1.3.1
  [2008-03-28 12:11:16] INFO  ruby 1.8.6 (2007-06-07) [x86_64-linux]
  [2008-03-28 12:11:21] INFO  WEBrick::HTTPServer#start: pid=8870 port=8888

In this example we see the port is the default 8888. Simply open your browser and navigate to:

  http://localhost:8888/

On the left side of the screen you will see a navigation tree, and the right side contans an infromation panel.

NOTE: Becuase ri itself isn’t very fast, if you use WebRI against the entire set of installed Ruby libraries it can take a few seconds to load up. (Sure wish FastRI turned out for the better.)

INSTALLATION

Installing via RubyGems is per the usual:

  $ sudo gem install webri

COPYING

WebRI Copyright © 2009 Thomas Sawyer, MIT License

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.