Skip to content

Commit d5a2548

Browse files
Merge pull request #8912 from rubygems/deivid-rodriguez/display-cache-no-all-deprecation
Fix `bundle cache --no-all` not printing a deprecation warning (cherry picked from commit f16e800)
1 parent f11e388 commit d5a2548

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

bundler/lib/bundler/cli.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ def fund
412412
D
413413
def cache
414414
print_remembered_flag_deprecation("--all", "cache_all", "true") if ARGV.include?("--all")
415+
print_remembered_flag_deprecation("--no-all", "cache_all", "false") if ARGV.include?("--no-all")
415416

416417
if flag_passed?("--path")
417418
message =

bundler/spec/other/major_deprecation_spec.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,28 @@
199199
pending "fails with a helpful error", bundler: "4"
200200
end
201201

202+
context "bundle cache --no-all" do
203+
before do
204+
install_gemfile <<-G
205+
source "https://gem.repo1"
206+
gem "myrack"
207+
G
208+
209+
bundle "cache --no-all", raise_on_error: false
210+
end
211+
212+
it "should print a deprecation warning" do
213+
expect(deprecations).to include(
214+
"The `--no-all` flag is deprecated because it relies on being " \
215+
"remembered across bundler invocations, which bundler will no " \
216+
"longer do in future versions. Instead please use `bundle config set " \
217+
"cache_all false`, and stop using this flag"
218+
)
219+
end
220+
221+
pending "fails with a helpful error", bundler: "4"
222+
end
223+
202224
context "bundle cache --path" do
203225
before do
204226
install_gemfile <<-G

0 commit comments

Comments
 (0)