gem_tools 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.2.0 2009-04-16
2
+ * Added the check_updates command
3
+ * Fixed the broken docs
4
+
1
5
  == 0.1.0 2009-04-08
2
6
  * change the rdoc and ri detection to not spew errors with rdoc 2
3
7
 
data/bin/gemtools CHANGED
@@ -20,7 +20,7 @@ MANDATORY_OPTIONS = %w()
20
20
 
21
21
  parser = OptionParser.new do |opts|
22
22
  opts.banner = <<BANNER
23
- GemTools can be used to make sure you have the propper gems and versions for
23
+ GemTools can be used to make sure you have the propper gems and versions for
24
24
  your app installed. It handles installing and loading gems during runtime.
25
25
 
26
26
  Usage: #{File.basename($0)} command [options]
@@ -30,11 +30,15 @@ Commands are:
30
30
  install
31
31
  Install the gems in ./gems.yml or ./config/gems.yml
32
32
 
33
- dryrun
33
+ dryrun
34
34
  Print out the commands that would have been run
35
35
 
36
36
  setup
37
- generate a started gems.yml
37
+ Generate a starter gems.yml
38
+
39
+ check_updates
40
+ Checks to see if there are newer versions available for the gems
41
+
38
42
  Options are:
39
43
  BANNER
40
44
 
@@ -53,7 +57,7 @@ BANNER
53
57
  puts opts; exit
54
58
  end
55
59
 
56
- OPTIONS = options
60
+ OPTIONS = opts
57
61
  end.parse!
58
62
 
59
63
  GemTools.run command
@@ -1,7 +1,7 @@
1
1
  module GemTools
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
- MINOR = 1
4
+ MINOR = 2
5
5
  TINY = 0
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
data/lib/gem_tools.rb CHANGED
@@ -5,7 +5,7 @@ module GemTools
5
5
  extend self
6
6
 
7
7
  def run(cmd)
8
- send(cmd.to_sym)# rescue help
8
+ send(cmd.to_sym) rescue help
9
9
  end
10
10
 
11
11
  def setup
@@ -122,4 +122,15 @@ module GemTools
122
122
  end
123
123
  nil
124
124
  end
125
+
126
+ def check_updates
127
+ config = load_config
128
+ gems = config['gems']
129
+
130
+ gems.each do |gem|
131
+ out = `gem list -r #{gem['name']}`
132
+ ver = out.match(/\(([0-9\.]+)\)/)[1] rescue 0
133
+ puts "#{gem['name']} #{ver} is available." if ver > gem['version']
134
+ end
135
+ end
125
136
  end
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.1.0
4
+ version: 0.2.0
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: 2009-04-08 00:00:00 -05:00
12
+ date: 2009-04-16 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency