Support Open Source

Vightel Corporation
Innovative Solutions

Rools Developer Documentation

Getting into Rools

A good starting point is studying the rools.rb example.

The next step would be to browse the unit tests. They show all the aspects of the inference engine.

If you get lost in the terminology, you can consult the glossary

Running the Unit Tests

Note : Rools is developed and tested on MacOSX (ruby 1.8.5 (2006-12-25 patchlevel 12) [i686-darwin8.8.3], this environment was built following the fine instructions from Dan Benjamin at Hivelogic)

Following the Rake tradition, you can run the unit tests from your openwfe-ruby tree with

    rake test

You can run tests one at a time with

    rake test TEST=test/facts_test.rb

Running the Specification Tests Automatically

This will run the tests everytime a file is changed. You can also install Growl/growlnotify to get alerted if a test fails. For more information, please check: Getting started with Autotest – Continuous Testing
    rake spec:autotest

Running the Specification Tests Manually

Rools is using RSpec You need to install the rspec gem on your system with a few others such as rcov

You can run specification tests with
    rake specs
or if you want full coverage analysis with:
    rake rcov
This will generate the coverage report and the specifcation report

Required Gems for Rake

The Rakefile for rools uses ‘rote’ and several of its filters to produce documentation. To avoid errors or incorrect markup processing, please install the following gems:

Tool versions

If you have problems running tests or specs, please check your configuration Here is my current output:
ruby 1.8.6 (2007-03-13 patchlevel 0) [powerpc-darwin8.9.0]
rake, version 0.7.2
Rails 1.2.3

*** LOCAL GEMS ***

rspec (1.0.5, 1.0.0)
    RSpec-1.0.5 (r2081) - BDD for Ruby

*** LOCAL GEMS ***

rubygems-update (0.9.2)
    RubyGems Update GEM

*** LOCAL GEMS ***

rote (0.3.4)
    Adds template-based doc support to Rake.

*** LOCAL GEMS ***

RedCloth (3.0.4)
    RedCloth is a module for using Textile and Markdown in Ruby. Textile
    and Markdown are text formats.  A very simple text format. Another
    stab at making readable text that can be converted to HTML.

*** LOCAL GEMS ***

syntax (1.0.0)
    Syntax is Ruby library for performing simple syntax highlighting.

*** LOCAL GEMS ***

rcov (
    Code coverage analysis tool for Ruby

*** LOCAL GEMS ***

ZenTest (3.6.0)
    ZenTest provides 4 different tools and 1 library: zentest,
    unit_diff, autotest, multiruby, and Test::Rails.