================================
The Ruby Interface to Open Babel (v. 1.0)
================================

This is the Ruby interface to the Open Babel library. 

Open Babel is a chemical toolbox designed to speak the many languages
of chemical data. It's an open, collaborative project allowing anyone
to search, convert, analyze, or store data from molecular modeling,
chemistry, solid-state materials, biochemistry, or related areas.

This code was automatically generated with SWIG and provides access to almost all 
of the Open Babel API via Ruby.

More details can also be found at the Open Babel website:
<http://openbabel.sourceforge.net/wiki/Ruby/>

INSTALLATION

To install this module, first install Open Babel. Then invoke the following commands:

$ ruby extconf.rb
$ make
# make install

USE

This module can be conveniently tested from irb (interactive ruby):

$ irb
irb(main):001:0> require 'openbabel'
=> true
irb(main):002:0> mol=OpenBabel::OBMol.new
=> #<OpenBabel::OBMol:0x2add323ddf58>
irb(main):003:0> mol.num_atoms
=> 0

Note: all Open Babel methods have been renamed to follow Ruby conventions. 
For example, the method to count the number of atoms in a molecule is
 "num_atoms", not "NumAtoms."

Also note: The following fields have been renamed for Ruby compatibility:

OpenBabel::OBResidueIndex::_1MA -> OpenBabel::OBResidueIndex::U1MA
OpenBabel::OBResidueIndex::_1MG -> OpenBabel::OBResidueIndex::U1MG
OpenBabel::OBResidueIndex::_2MG -> OpenBabel::OBResidueIndex::U2MG
OpenBabel::OBResidueIndex::_7MG -> OpenBabel::OBResidueIndex::U7MG
OpenBabel::OBResidueIndex::_5MU -> OpenBabel::OBResidueIndex::U5MU
OpenBabel::OBResidueIndex::_5MC -> OpenBabel::OBResidueIndex::U5MC

USING SWIG TO GENERATE THE WRAPPER C++ CODE

Given the "openbabel-ruby.i" interface file (contained in this directory's 
parent directory), wrapper code can be generated with SWIG. From the directory
containing this README, use the following command:

swig -ruby -autorename -c++ -I../../include -o openbabel_ruby.cpp ../openbabel-ruby.i

This command produces the glue code "openbabel_ruby.cpp".

To disable the autorenaming of Open Babel methods, use the "-noautorename"
flag (SWIG 1.3.29+). Earlier SWIG versions don't support renaming.

Generating the C++ glue code using SWIG currently gives a top-level module 
called "Openbabel" instead of "OpenBabel". To use the latter name, change the 
argument to "rb_define_module" from "Openbabel" to "OpenBabel" in 
openbabel_ruby.cpp. These modifications are also made automatically by the 
Open Babel makefiles. Make sure you run ./configure with the 
--enable-maintainer-mode flag when building Open Babel to enable rebuilding
these scripting interfaces.

COPYRIGHT AND LICENSE

Copyright (C) 2007 Geoffrey R. Hutchison  <babel@geoffhutchison.net> 
    and Richard L. Apodaca <rich_apodaca@yahoo.com>

This Ruby module is part of the Open Babel project.
<http://openbabel.sourceforge.net/>

Open Babel is distributed under the GNU General Public License (GPL).
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 2 of the License. Full details
can be found in the file "COPYING" which should be included in your
distribution.

