Skip to content

Commit 3bbbf4a

Browse files
Make bundle show --outdated raise an error
1 parent fa1a80f commit 3bbbf4a

File tree

6 files changed

+7
-44
lines changed

6 files changed

+7
-44
lines changed

bundler/lib/bundler/cli.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,11 @@ def update(*gems)
283283
Calling show with [GEM] will list the exact location of that gem on your machine.
284284
D
285285
method_option "paths", type: :boolean, banner: "List the paths of all gems that are required by your Gemfile."
286-
method_option "outdated", type: :boolean, banner: "Show verbose output including whether gems are outdated."
286+
method_option "outdated", type: :boolean, banner: "Show verbose output including whether gems are outdated (removed)."
287287
def show(gem_name = nil)
288288
if ARGV.include?("--outdated")
289-
message = "the `--outdated` flag to `bundle show` will be removed in favor of `bundle show --verbose`"
290289
removed_message = "the `--outdated` flag to `bundle show` has been removed in favor of `bundle show --verbose`"
291-
SharedHelpers.major_deprecation(2, message, removed_message: removed_message)
290+
raise InvalidOption, removed_message
292291
end
293292
require_relative "cli/show"
294293
Show.new(options, gem_name).run

bundler/lib/bundler/cli/show.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class CLI::Show
66
def initialize(options, gem_name)
77
@options = options
88
@gem_name = gem_name
9-
@verbose = options[:verbose] || options[:outdated]
9+
@verbose = options[:verbose]
1010
@latest_specs = fetch_latest_specs if @verbose
1111
end
1212

bundler/lib/bundler/man/bundle-show.1

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
.SH "NAME"
55
\fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
66
.SH "SYNOPSIS"
7-
\fBbundle show\fR [GEM] [\-\-paths] [\-\-outdated]
7+
\fBbundle show\fR [GEM] [\-\-paths]
88
.SH "DESCRIPTION"
99
Without the [GEM] option, \fBshow\fR will print a list of the names and versions of all gems that are required by your [\fBGemfile(5)\fR][Gemfile(5)], sorted by name\.
1010
.P
@@ -13,7 +13,4 @@ Calling show with [GEM] will list the exact location of that gem on your machine
1313
.TP
1414
\fB\-\-paths\fR
1515
List the paths of all gems that are required by your [\fBGemfile(5)\fR][Gemfile(5)], sorted by gem name\.
16-
.TP
17-
\fB\-\-outdated\fR
18-
Show verbose output including whether gems are outdated\.
1916

bundler/lib/bundler/man/bundle-show.1.ronn

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ bundle-show(1) -- Shows all the gems in your bundle, or the path to a gem
55

66
`bundle show` [GEM]
77
[--paths]
8-
[--outdated]
98

109
## DESCRIPTION
1110

@@ -20,6 +19,3 @@ machine.
2019
* `--paths`:
2120
List the paths of all gems that are required by your [`Gemfile(5)`][Gemfile(5)],
2221
sorted by gem name.
23-
24-
* `--outdated`:
25-
Show verbose output including whether gems are outdated.

bundler/spec/commands/show_spec.rb

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -210,33 +210,6 @@
210210
expect(err).to include("Could not find gem '#{invalid_regexp}'.")
211211
end
212212
end
213-
214-
context "--outdated option" do
215-
# Regression test for https://github.com/rubygems/bundler/issues/5375
216-
before do
217-
build_repo2
218-
end
219-
220-
it "doesn't update gems to newer versions" do
221-
install_gemfile <<-G
222-
source "https://gem.repo2"
223-
gem "rails"
224-
G
225-
226-
expect(the_bundle).to include_gem("rails 2.3.2")
227-
228-
update_repo2 do
229-
build_gem "rails", "3.0.0" do |s|
230-
s.executables = "rails"
231-
end
232-
end
233-
234-
bundle "show --outdated"
235-
236-
bundle "install"
237-
expect(the_bundle).to include_gem("rails 2.3.2")
238-
end
239-
end
240213
end
241214

242215
RSpec.describe "bundle show", bundler: "5" do

bundler/spec/other/major_deprecation_spec.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -649,14 +649,12 @@
649649

650650
context "with --outdated flag" do
651651
before do
652-
bundle "show --outdated"
652+
bundle "show --outdated", raise_on_error: false
653653
end
654654

655-
it "prints a deprecation warning informing about its removal" do
656-
expect(deprecations).to include("the `--outdated` flag to `bundle show` will be removed in favor of `bundle show --verbose`")
655+
it "fails with a helpful message" do
656+
expect(err).to include("the `--outdated` flag to `bundle show` has been removed in favor of `bundle show --verbose`")
657657
end
658-
659-
pending "fails with a helpful message", bundler: "4"
660658
end
661659
end
662660

0 commit comments

Comments
 (0)