Skip to content

Commit 802fc71

Browse files
Merge pull request #8980 from rubygems/deivid-rodriguez/make-bundle-show-outdated-raise-an-error
Make `bundle show --outdated` raise an error
2 parents 6f71e0d + 3bbbf4a commit 802fc71

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
@@ -288,12 +288,11 @@ def update(*gems)
288288
Calling show with [GEM] will list the exact location of that gem on your machine.
289289
D
290290
method_option "paths", type: :boolean, banner: "List the paths of all gems that are required by your Gemfile."
291-
method_option "outdated", type: :boolean, banner: "Show verbose output including whether gems are outdated."
291+
method_option "outdated", type: :boolean, banner: "Show verbose output including whether gems are outdated (removed)."
292292
def show(gem_name = nil)
293293
if ARGV.include?("--outdated")
294-
message = "the `--outdated` flag to `bundle show` will be removed in favor of `bundle show --verbose`"
295294
removed_message = "the `--outdated` flag to `bundle show` has been removed in favor of `bundle show --verbose`"
296-
SharedHelpers.major_deprecation(2, message, removed_message: removed_message)
295+
raise InvalidOption, removed_message
297296
end
298297
require_relative "cli/show"
299298
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
@@ -647,14 +647,12 @@
647647

648648
context "with --outdated flag" do
649649
before do
650-
bundle "show --outdated"
650+
bundle "show --outdated", raise_on_error: false
651651
end
652652

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

0 commit comments

Comments
 (0)