summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2020-05-25 12:19:13 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-06-05 07:32:42 +0900
commitd52b1b0705a6aa5587350ce01b293ed6bf7bdad7 (patch)
tree0d2adb0b644d173820016e45476c4558ebaf3c78 /lib
parent97267227bbd8c322cf17c1e0ae380f74afbc29fb (diff)
[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
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3184
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/cli.rb14
1 files changed, 14 insertions, 0 deletions
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