public
Description: The gem verison of my lightweight tool to manage gems using a config file, similar to GemInstaller.
Homepage:
Clone URL: git://github.com/UnderpantsGnome/gem_tools-gem.git
fix the Kernel::gem test. make sure to use the right gem command when checking 
gems
Fri Nov 14 10:46:29 -0800 2008
commit  7e6d5556568566e851fb8e288204fdef751e01b2
tree    899fdd3638551215feba39656e6f17f35f4ec82b
parent  6c971b05c9c2047ba2676857d8dadede16bfd94c
...
1
 
 
 
 
 
2
3
4
...
 
1
2
3
4
5
6
7
8
0
@@ -1,4 +1,8 @@
0
-== 0.0.6 2008-09-30
0
+== 0.0.8 2008-11-14
0
+* Fix the check for Kernel::gem
0
+* Make sure to use the right gem command when checking gems
0
+
0
+== 0.0.7 2008-09-30
0
 * no more coding when tired
0
 
0
 == 0.0.6 2008-09-26
...
3
4
5
6
 
7
8
9
...
14
15
16
17
 
18
19
20
...
25
26
27
28
 
29
30
31
...
64
65
66
67
 
68
69
70
...
85
86
87
88
 
89
90
91
...
103
104
105
106
107
108
 
 
 
109
110
111
...
114
115
116
117
 
118
119
120
...
123
124
125
126
127
...
3
4
5
 
6
7
8
9
...
14
15
16
 
17
18
19
20
...
25
26
27
 
28
29
30
31
...
64
65
66
 
67
68
69
70
...
85
86
87
 
88
89
90
91
...
103
104
105
 
 
 
106
107
108
109
110
111
...
114
115
116
 
117
118
119
120
...
123
124
125
 
126
0
@@ -3,7 +3,7 @@ $:.unshift(File.dirname(__FILE__)) unless
0
 
0
 module GemTools
0
   extend self
0
-  
0
+
0
   def run(cmd)
0
     send(cmd.to_sym)# rescue help
0
   end
0
@@ -14,7 +14,7 @@ module GemTools
0
     if File.exist?(dest_file) && ! OPTIONS.has_key?(:force)
0
       puts "#{dest_file} already exists.\n\ngemtools install #{ARGV[1]} --force\n\nto overwrite"
0
       exit 1
0
-    else 
0
+    else
0
       FileUtils.copy(File.join(File.dirname(__FILE__), '../config/gems.template.yml'), dest_file)
0
       puts "#{dest_file} created"
0
     end
0
@@ -25,7 +25,7 @@ module GemTools
0
     unless config['gems'].nil?
0
       gems = config['gems'].reject {|gem_info| ! gem_info['load'] }
0
       gems.each do |gem_info|
0
-        if defined?(Kernel::gem)
0
+        if defined?(gem)
0
           gem gem_info['name'], gem_info['version']
0
         else
0
           require_gem gem_info['name'], gem_info['version']
0
@@ -64,7 +64,7 @@ module GemTools
0
       end
0
     end
0
   end
0
-  
0
+
0
   def dryrun
0
     puts "\n#{commands.join("\n")}\n\n"
0
   end
0
@@ -85,7 +85,7 @@ module GemTools
0
       gem_dash_y = "1.0" > Gem::RubyGemsVersion ? '-y' : ''
0
 
0
       gems.each do |gem|
0
-        spec, loaded, version = check_gem(gem['name'], gem['version'])
0
+        spec, loaded, version = check_gem(gem_command, gem['name'], gem['version'])
0
         # if forced
0
         # or the spec version doesn't match the required version
0
         # or require_gem returns false
0
@@ -103,9 +103,9 @@ module GemTools
0
     end
0
     commands
0
   end
0
-  
0
-  def check_gem(name, version='')
0
-    spec = YAML.load(`gem spec #{name} 2> /dev/null`)
0
+
0
+  def check_gem(command, name, version='')
0
+    spec = YAML.load(`#{command} spec #{name} 2> /dev/null`)
0
     loaded = false
0
     begin
0
       loaded = require_gem name, version
0
@@ -114,7 +114,7 @@ module GemTools
0
     end
0
     [spec, loaded, version]
0
   end
0
-  
0
+
0
   def find_config
0
     %w( . config ).each do |dir|
0
       config_file = File.join(dir, 'gems.yml')
0
@@ -123,4 +123,3 @@ module GemTools
0
     nil
0
   end
0
 end
0
-  
0
\ No newline at end of file
...
2
3
4
5
 
6
7
8
...
2
3
4
 
5
6
7
8
0
@@ -2,7 +2,7 @@ module GemTools
0
   module VERSION #:nodoc:
0
     MAJOR = 0
0
     MINOR = 0
0
-    TINY  = 7
0
+    TINY  = 8
0
 
0
     STRING = [MAJOR, MINOR, TINY].join('.')
0
   end

Comments