outdated-gems 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.4.0
data/lib/outdated-gems.rb CHANGED
@@ -1,29 +1,26 @@
1
- require 'yaml'
2
-
3
- file = File.join(Dir.pwd, 'Gemfile.lock')
4
-
5
- if File.exists?(file)
6
- gemfile = File.open(file) { |yf| YAML::load(yf) }
7
- gems = gemfile['specs'].inject({}) do |gems, g|
8
- g = g.to_a[0]
9
- name = g[0]
10
- version = g[1]['version']
11
- gems[name] = version
12
- gems
1
+ if (bundle = `bundle show`) && !bundle.include?("Could not locate Gemfile")
2
+ gems = {}
3
+ bundle.each_line do |line|
4
+ if line =~ /^\s+\* (.*?) \(([\w.]+)\)/
5
+ gems[$~[1]] = $~[2]
6
+ end
13
7
  end
14
-
15
8
  outdated_gems = {}
16
-
17
9
  gem_list = Gem::SpecFetcher.new.list.values.first
18
-
19
10
  gems.each do |name, v_current|
20
11
  latest_gem = gem_list.detect { |g| g.first == name }
21
- if latest_gem[1] > Gem::Version.create(v_current)
12
+ if latest_gem[2] == "ruby" && latest_gem[1] > Gem::Version.create(v_current)
22
13
  outdated_gems[name] = "#{v_current} => #{latest_gem[1].version}"
23
14
  end
24
15
  end
25
-
26
- outdated_gems.each do |name, change|
27
- puts "#{name}: #{change}"
16
+ if outdated_gems.empty?
17
+ puts "No outdated gems."
18
+ else
19
+ puts "Outdated gems:"
20
+ outdated_gems.each do |name, change|
21
+ puts "#{name}: #{change}"
22
+ end
28
23
  end
24
+ else
25
+ puts bundle
29
26
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{outdated-gems}
8
- s.version = "0.3.0"
8
+ s.version = "0.4.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Aaron Gibralter"]
12
- s.date = %q{2010-05-07}
12
+ s.date = %q{2010-06-30}
13
13
  s.default_executable = %q{outdated_gems}
14
14
  s.description = %q{Run `outdated_gems` in a directory containing a Gemfile.lock and it will print the results.}
15
15
  s.email = %q{aaron.gibralter@gmail.com}
@@ -35,9 +35,12 @@ Gem::Specification.new do |s|
35
35
  s.specification_version = 3
36
36
 
37
37
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
38
+ s.add_runtime_dependency(%q<bundler>, [">= 0.9.26"])
38
39
  else
40
+ s.add_dependency(%q<bundler>, [">= 0.9.26"])
39
41
  end
40
42
  else
43
+ s.add_dependency(%q<bundler>, [">= 0.9.26"])
41
44
  end
42
45
  end
43
46
 
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 3
7
+ - 4
8
8
  - 0
9
- version: 0.3.0
9
+ version: 0.4.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Aaron Gibralter
@@ -14,10 +14,23 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-07 00:00:00 -04:00
17
+ date: 2010-06-30 00:00:00 -04:00
18
18
  default_executable: outdated_gems
19
- dependencies: []
20
-
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: bundler
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ - 9
30
+ - 26
31
+ version: 0.9.26
32
+ type: :runtime
33
+ version_requirements: *id001
21
34
  description: Run `outdated_gems` in a directory containing a Gemfile.lock and it will print the results.
22
35
  email: aaron.gibralter@gmail.com
23
36
  executables: