                               The Linux Registry
                                 A Ruby Binding

                                Sean E. Russell
                                      2004

WHAT


The Linux Registry [http://registry.sourceforge.net] is a toolkit that provides
a programmatic registry for Linux applications.  The term "registry" is taken
from Windows, but the idea dates back to at least NeXTSTEP, which had a similar
concept.  The idea is that persistent properties are managed by a simple
library and are available to applications for setting configuration data in a
consistent manner.  Read the main Linux Registry page for more in-depth reasons
as to why this is a good thing.

This project, in particular, provides a Ruby binding for the Linux Registry,
providing an easy API for accessing registry variables.


WHERE

The source repository (Subversion) is at:

  http://www.germane-software.com/repositories/public/repository

The project page is at:

  http://www.germane-software.com/software/Util/registry


HOW

There are six methods currently implemented, which should be enough for average
use:

  * open()
  * close()
  * get()
  * set()
  * keys()
  * remove()

Here's some example code:

  #!/usr/bin/ruby

  Registry::open() {
    Registry::set( "user/lib/registry/version", "0.2.2" )
      p Registry::get( "user/lib/registry/version" )
      p Registry::keys
      Registry::remove( "user/lib/registry/version" )
  }

This generates:

  "0.2.2"
  ["system", "user:ser", "user:ser/lib/registry/version"]

Note that if you use closures, you don't have to explicitly close the registry.
You can also call it like this:

  Registry::open
  Registry::keys
  Registry::close


INSTALLATION

To use this, have The Linux Registry and Ruby installed; change into the
project directory and do:

  % ruby extconf.rb
  % make
  % sudo make install       # or similar

Actually, the install isn't necessary as long as registry.so is in the Ruby
class path, which includes ".".


CAVEATS

* The Ruby binding doesn't deal with non-string data yet.  Soon, Grasshopper.
* Much of the Linux Registry API is missing.  For the most part, this doesn't
  matter, since you can do almost everything with what is provided.  However,
  the API dealing with permissions will be necessary.
* The API for getting a list of keys should be expanded upon, to support
  filtering to the extent that registryGetChildKeys() supports.
  
--- SER
