h1. gem_tools
h2. What
The gem verison of my lightweight tool to manage gems using a config file,
similar to GemInstaller.
h2. Installing
<pre syntax="ruby">sudo gem install gem_tools</pre>
h2. The basics
I use this to manage gem versions in my apps, it has a rake task to install gems
and a load utility to load them on startup.
Install or update required gems
<pre><code>
gem_tools install
</pre></code>
Make sure they are loaded with the right versions during startup, by adding the
following to your script or environment.rb (Rails)
<pre><code>
require 'gem_tools'
GemTools.load_gems
</pre></code>
The config file looks like
<pre><code>
# These are optional
:source: http://local_mirror.example.com
gem_command: 'jruby -S gem'
:gems:
- :name: mongrel
:version: "1.0"
# this gem has a specfic source URL
:source: 'http://mongrel.rubyforge.org/releases'
- :name: hpricot_scrub
:version: '0.3.3'
# this tells us to load not just install
:load: true
- :name: postgres
:version: '0.7.1'
:load: true
# any extra config that needs to be passed to gem install
:config: '--with-pgsql-include-dir=/usr/local/pgsql/include
--with-pgsql-lib-dir=/usr/local/pgsql/lib'
- :name: rfeedparser_ictv
:version: '0.9.932'
:load: true
# this one has a different load name than the gem name (not a normal need)
:require_name: 'rfeedparser'
</pre></code>
You can fetch the source from either:
<pre>git clone git://rubyforge.org/gem_tools.git</pre>
* github: "http://github.com/UnderpantsGnome/gem_tools/tree/master":http://github.com/UnderpantsGnome/gem_tools/tree/master
<pre>git clone git://github.com/UnderpantsGnome/gem_tools.git</pre>
h3. Build and test instructions
<pre>cd gem_tools
rake test
rake install_gem</pre>
h2. License
This code is free to use under the terms of the MIT license.
h2. Contact
Comments are welcome. Send an email to "Michael Moen":mailto:michael@underpantsgnome.com via the "forum":http://groups.google.com/group/gem_tools