diff options
author | Stefan Lance <stefan@lances.net> | 2015-06-20 15:49:57 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-07-05 15:11:19 -0300 |
commit | 055f95b62dae20eaa34a4cf2a4919b1fbd0da4ed (patch) | |
tree | c0fb86fa211d7ffbe6fa9296305d3856bffb617d | |
parent | f58f04277cb47dc9b1fdfe401a15bbe281dfa7c3 (diff) | |
download | bundler-055f95b62dae20eaa34a4cf2a4919b1fbd0da4ed.tar.gz |
Show deprecation warning when using --binstubs
-rw-r--r-- | .rubocop.yml | 5 | ||||
-rw-r--r-- | lib/bundler/cli/install.rb | 6 | ||||
-rw-r--r-- | spec/other/major_deprecation_spec.rb | 11 |
3 files changed, 22 insertions, 0 deletions
diff --git a/.rubocop.yml b/.rubocop.yml index 8ad27fbe1f..cbce695fbd 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -118,3 +118,8 @@ Metrics/AbcSize: Metrics/CyclomaticComplexity: Enabled: false + +# It will be obvious which code is complex, Rubocop should only lint simple +# rules for us. +Metrics/PerceivedComplexity: + Enabled: false diff --git a/lib/bundler/cli/install.rb b/lib/bundler/cli/install.rb index 07950c9010..306732413b 100644 --- a/lib/bundler/cli/install.rb +++ b/lib/bundler/cli/install.rb @@ -55,6 +55,12 @@ module Bundler Bundler::Fetcher.disable_endpoint = options["full-index"] + if options["binstubs"] + Bundler.ui.deprecate("The --binstubs option will be removed from "\ + "Bundler 2.0 and replaced with "\ + "`bundle binstubs`\n") + end + # rubygems plugins sometimes hook into the gem install process Gem.load_env_plugins if Gem.respond_to?(:load_env_plugins) diff --git a/spec/other/major_deprecation_spec.rb b/spec/other/major_deprecation_spec.rb index a3d8fd12f4..0b41a7233a 100644 --- a/spec/other/major_deprecation_spec.rb +++ b/spec/other/major_deprecation_spec.rb @@ -74,5 +74,16 @@ describe "major deprecations" do expect(warnings).not_to have_major_deprecation end end + + describe "bundle install --binstubs" do + it "should output a deprecation warning" do + gemfile <<-G + gem 'rack' + G + + bundle :install, :binstubs + expect(warnings).to have_major_deprecation a_string_including("The --binstubs option will be removed") + end + end end end |