From d52b1b0705a6aa5587350ce01b293ed6bf7bdad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Mon, 25 May 2020 12:19:13 +0200 Subject: [rubygems/rubygems] Deprecate the `--no-deployment` flag And never recommend it inside CLI messages. This flag represents the default behaviour of `bundle install`, and the only reason it exists is to "override" previous `--deployment` flag usages which were silently remembered. So it should be deprecated just like all the other flags the rely on remembering their values across invocations. https://github.com/rubygems/rubygems/commit/40e50b7190 --- lib/bundler/cli.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib') diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index f7613287d0..3d5194d61f 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -254,6 +254,8 @@ module Bundler remembered_flag_deprecation(option) end + remembered_negative_flag_deprecation("no-deployment") + require_relative "cli/install" Bundler.settings.temporary(:no_install => false) do Install.new(options.dup).run @@ -812,10 +814,22 @@ module Bundler nil end + def remembered_negative_flag_deprecation(name) + positive_name = name.gsub(/\Ano-/, "") + option = current_command.options[positive_name] + flag_name = "--no-" + option.switch_name.gsub(/\A--/, "") + + flag_deprecation(positive_name, flag_name, option) + end + def remembered_flag_deprecation(name) option = current_command.options[name] flag_name = option.switch_name + flag_deprecation(name, flag_name, option) + end + + def flag_deprecation(name, flag_name, option) name_index = ARGV.find {|arg| flag_name == arg.split("=")[0] } return unless name_index -- cgit v1.2.3