Navigation
Learn About
Developing With
Ingres Talk
Information
Toolbox
Views
Ruby/Projects/Gem Package
From Ingres Community Wiki
Contents |
Introduction
This project will look at better ways to distribute and install the Ingres Ruby driver and Ruby on Rails (RoR) adapter.
Current Situation
Obtaining, building and installing the Ingres Ruby and RoR adapter is an onerous task that could be simplified in to a single step. The current process goes like this for Linux/UNIX
- download the source code from http://esd.ingres.com/product/drivers/Ruby_on_Rails
- unpack the source code
- cd to unpacked directory
- build the Ruby driver using
ruby extconf.rb && make- Making sure
$II_SYSTEMis defined
- Making sure
- install the Ruby driver using
sudo make install - enter password prompted
- copy ingres_adapter.rb to
${GEMDIR}/activerecord-x.x.x/lib/active_record/connection_adapters/- Where x.x.x is the version of activerecord/rails currently installed
Each time Rails is updated the last step has to be repeated to make sure the new version of activerecord can access Ingres.
Proposal(s)
User View
Using RubyGems it's possible to combine the above 7-8 steps into a single command:
gem install activerecord-ingres-adapter
This one command would:
- download the activerecord-ingres-adapter from http://rubyforge.org
- lay the files down in
${GEMDIR}/activerecord-ingres-adapter-x.x.x - Add
${GEMDIR}/activerecord-ingres-adapter-x.x.x/libto the list of required library directories - compile the Ruby driver
- assuming
$II_SYSTEMis defined - install the driver into the correct location
- assuming
- Build the documentation
Developer / Maintainer View
The traditional way to define what is contained within a gem is to use the Gem Specification. E.g.
spec = Gem::Specification.new do |s|
s.name = 'example'
s.version = '1.0'
s.summary = 'Example gem specification'
...
end
Once you have your gemspec you generate the gem using following command:
gem build
and out pops the generated gem
Since the original Gem Specification was developed a number of gems have been developed to improve upon the original specification to provide the following features:
- Run the provided test suite
- Publish to an external repository such as
- Generate Zip and GZip Tar archives
Test Gem
A test gem based on 1.4.0 is available for download from http://dl.dropbox.com/u/2191213/ruby/activerecord-ingres-adapter-1.4.0.gem. Since this gem builds the driver you will need a C compiler and an Ingres environment

