UnderpantsGnome / gem_tools-gem

The gem verison of my lightweight tool to manage gems using a config file, similar to GemInstaller.

This URL has Read+Write access

gem_tools-gem / website / index.txt
100644 82 lines (57 sloc) 2.035 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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