gem_tools 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,4 +1,8 @@
1
- == 0.0.6 2008-09-30
1
+ == 0.0.8 2008-11-14
2
+ * Fix the check for Kernel::gem
3
+ * Make sure to use the right gem command when checking gems
4
+
5
+ == 0.0.7 2008-09-30
2
6
  * no more coding when tired
3
7
 
4
8
  == 0.0.6 2008-09-26
@@ -2,7 +2,7 @@ module GemTools
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 7
5
+ TINY = 8
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/lib/gem_tools.rb CHANGED
@@ -3,7 +3,7 @@ $:.unshift(File.dirname(__FILE__)) unless
3
3
 
4
4
  module GemTools
5
5
  extend self
6
-
6
+
7
7
  def run(cmd)
8
8
  send(cmd.to_sym)# rescue help
9
9
  end
@@ -14,7 +14,7 @@ module GemTools
14
14
  if File.exist?(dest_file) && ! OPTIONS.has_key?(:force)
15
15
  puts "#{dest_file} already exists.\n\ngemtools install #{ARGV[1]} --force\n\nto overwrite"
16
16
  exit 1
17
- else
17
+ else
18
18
  FileUtils.copy(File.join(File.dirname(__FILE__), '../config/gems.template.yml'), dest_file)
19
19
  puts "#{dest_file} created"
20
20
  end
@@ -25,7 +25,7 @@ module GemTools
25
25
  unless config['gems'].nil?
26
26
  gems = config['gems'].reject {|gem_info| ! gem_info['load'] }
27
27
  gems.each do |gem_info|
28
- if defined?(Kernel::gem)
28
+ if defined?(gem)
29
29
  gem gem_info['name'], gem_info['version']
30
30
  else
31
31
  require_gem gem_info['name'], gem_info['version']
@@ -64,7 +64,7 @@ module GemTools
64
64
  end
65
65
  end
66
66
  end
67
-
67
+
68
68
  def dryrun
69
69
  puts "\n#{commands.join("\n")}\n\n"
70
70
  end
@@ -85,7 +85,7 @@ module GemTools
85
85
  gem_dash_y = "1.0" > Gem::RubyGemsVersion ? '-y' : ''
86
86
 
87
87
  gems.each do |gem|
88
- spec, loaded, version = check_gem(gem['name'], gem['version'])
88
+ spec, loaded, version = check_gem(gem_command, gem['name'], gem['version'])
89
89
  # if forced
90
90
  # or the spec version doesn't match the required version
91
91
  # or require_gem returns false
@@ -103,9 +103,9 @@ module GemTools
103
103
  end
104
104
  commands
105
105
  end
106
-
107
- def check_gem(name, version='')
108
- spec = YAML.load(`gem spec #{name} 2> /dev/null`)
106
+
107
+ def check_gem(command, name, version='')
108
+ spec = YAML.load(`#{command} spec #{name} 2> /dev/null`)
109
109
  loaded = false
110
110
  begin
111
111
  loaded = require_gem name, version
@@ -114,7 +114,7 @@ module GemTools
114
114
  end
115
115
  [spec, loaded, version]
116
116
  end
117
-
117
+
118
118
  def find_config
119
119
  %w( . config ).each do |dir|
120
120
  config_file = File.join(dir, 'gems.yml')
@@ -123,4 +123,3 @@ module GemTools
123
123
  nil
124
124
  end
125
125
  end
126
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Moen
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-09-30 00:00:00 -05:00
12
+ date: 2008-11-14 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 1.7.0
23
+ version: 1.8.2
24
24
  version:
25
25
  description: A lightweight tool to manage gems using a config file, similar to GemInstaller
26
26
  email: