Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Bloody hell, I think I finally got outdated to show the correctly out…
Browse files Browse the repository at this point in the history
…dated gems. fixes #1174
  • Loading branch information
joelmoss committed May 17, 2011
1 parent 2be6859 commit 7cf8aea
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
21 changes: 16 additions & 5 deletions lib/bundler/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,24 @@ def outdated(*gems)
end

options["local"] ? definition.resolve_with_cache! : definition.resolve_remotely!


Bundler.ui.info "Outdated gems included in the bundle:"
definition.specs.each do |s|
cs = current_specs.find{|spec| spec.name == s.name }
if cs.version != s.version || cs.git_version != s.git_version
Bundler.ui.info " * #{s.name} (#{s.version}#{s.git_version} > #{cs.version}#{cs.git_version}) "
next if !gems.empty? && !gems.include?(s.name)

s.source.fetch(s) if s.source.respond_to?(:fetch)

if s.git_version
cs = current_specs.find {|spec| spec.name == s.name }
else
cs = s
s = definition.index[cs.name].sort_by { |b| b.version }.last
end

if Gem::Version.new(s.version) > Gem::Version.new(cs.version) || cs.git_version != s.git_version
Bundler.ui.info " * #{s.name} (#{s.version}#{s.git_version} > #{cs.version}#{cs.git_version})"
end
Bundler.ui.debug "from #{s.loaded_from} "
Bundler.ui.debug "from #{s.loaded_from}"
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/other/outdated_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require "spec_helper"
require "pp"

describe "bundle outdated" do

Expand All @@ -10,8 +11,7 @@

install_gemfile <<-G
source "file://#{gem_repo2}"
gem "activesupport"
gem "rack-obama"
gem "activesupport", "2.3.5"
gem "foo", :git => "#{lib_path('foo')}"
G
end
Expand Down

0 comments on commit 7cf8aea

Please sign in to comment.