aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/cli/outdated.rb
diff options
context:
space:
mode:
authorDavid Blondeau <david@collaborativedrug.com>2014-01-26 21:45:24 -0800
committerDavid Blondeau <david@collaborativedrug.com>2014-01-26 21:50:46 -0800
commit8e10c26fadb4d7b12a9bc7e7a8ccdbdd945e5158 (patch)
treeb52b08cd862faec6b4cafd9bb8107428bf578419 /lib/bundler/cli/outdated.rb
parentaeb3df71e4cd6831b2619731a024e74a2b4c8fdd (diff)
downloadbundler-8e10c26fadb4d7b12a9bc7e7a8ccdbdd945e5158.tar.gz
DB: Better outdated --strict.
It now behaves exactly like if performing a dry run of `bundle update`
Diffstat (limited to 'lib/bundler/cli/outdated.rb')
-rw-r--r--lib/bundler/cli/outdated.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb
index 7859bedc..ee6387ac 100644
--- a/lib/bundler/cli/outdated.rb
+++ b/lib/bundler/cli/outdated.rb
@@ -38,15 +38,13 @@ module Bundler
dependency = current_dependencies[current_spec.name]
- active_spec = definition.index[current_spec.name].sort_by { |b| b.version }
- if !current_spec.version.prerelease? && !options[:pre] && active_spec.size > 1
- active_spec = active_spec.delete_if { |b| b.respond_to?(:version) && b.version.prerelease? }
- end
if options["strict"]
- active_spec = active_spec.reverse.detect do |b|
- dependency && b.respond_to?(:version) && dependency.requirement.satisfied_by?(b.version)
- end || active_spec.last
+ active_spec = definition.specs.detect { |spec| spec.name == current_spec.name }
else
+ active_spec = definition.index[current_spec.name].sort_by { |b| b.version }
+ if !current_spec.version.prerelease? && !options[:pre] && active_spec.size > 1
+ active_spec = active_spec.delete_if { |b| b.respond_to?(:version) && b.version.prerelease? }
+ end
active_spec = active_spec.last
end
next if active_spec.nil?