summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorchrismo <chrismo@clabs.org>2016-10-13 00:12:48 -0500
committerchrismo <chrismo@clabs.org>2016-10-19 09:47:07 -0500
commit9c1c3a0e3a3cf5b65b5f6d499eb368de4ec23dff (patch)
tree4facc6af85b32e2ba90ec8ea47d4b858a8b15fef /lib
parentb8c23f39399d8a6296ea268e7fcd57d3ac712467 (diff)
downloadbundler-9c1c3a0e3a3cf5b65b5f6d499eb368de4ec23dff.tar.gz
filtered outdated msg shouldn't say 'up to date'
Fixes #5076. When a filter option is in use and it filters out everything in the requested categories, it's safer to say there were no %{level} updates to display rather than "Bundle up to date!" Tracking an additional local variable with the exact info to know that even when filtered there was nothing to update anyway I didn't feel was worth it with the current design.
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/cli/outdated.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb
index 60ac869637..1d5b8e0242 100644
--- a/lib/bundler/cli/outdated.rb
+++ b/lib/bundler/cli/outdated.rb
@@ -94,7 +94,7 @@ module Bundler
end
if outdated_gems_list.empty?
- Bundler.ui.info "Bundle up to date!\n" unless options[:parseable]
+ display_nothing_outdated_message
else
unless options[:parseable]
if options[:pre]
@@ -141,6 +141,18 @@ module Bundler
private
+ def display_nothing_outdated_message
+ unless options[:parseable]
+ filter_options = options.keys & %w(filter-major filter-minor filter-patch)
+ if filter_options.any?
+ display = filter_options.map {|o| o.sub("filter-", "") }.join(" or ")
+ Bundler.ui.info "No #{display} updates to display.\n"
+ else
+ Bundler.ui.info "Bundle up to date!\n"
+ end
+ end
+ end
+
def print_gem(current_spec, active_spec, dependency, groups, options_include_groups)
spec_version = "#{active_spec.version}#{active_spec.git_version}"
current_version = "#{current_spec.version}#{current_spec.git_version}"