diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2017-06-19 21:39:37 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-07-02 15:43:51 +0200 |
commit | 14fc45504de855e8103efbd70afe0b03768973d3 (patch) | |
tree | dccc0bcf369558b1efec17f3f51a391aee45769b | |
parent | 5e8243ba4845bd87238eb9dfb8ca765683f9229f (diff) | |
download | bundler-seg-deprecate-console.tar.gz |
Remove the console command in Bundler 2.0seg-deprecate-console
-rw-r--r-- | lib/bundler/cli.rb | 11 | ||||
-rw-r--r-- | lib/bundler/feature_flag.rb | 1 | ||||
-rw-r--r-- | lib/bundler/settings.rb | 1 | ||||
-rw-r--r-- | spec/commands/console_spec.rb | 2 | ||||
-rw-r--r-- | spec/other/platform_spec.rb | 2 | ||||
-rw-r--r-- | spec/quality_spec.rb | 1 |
6 files changed, 11 insertions, 7 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index 94ca5dfa25..b4437c9aec 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -395,11 +395,12 @@ module Bundler Open.new(options, name).run end - desc "console [GROUP]", "Opens an IRB session with the bundle pre-loaded" - def console(group = nil) - # TODO: Remove for 2.0 - require "bundler/cli/console" - Console.new(options, group).run + if Bundler.feature_flag.console_command? + desc "console [GROUP]", "Opens an IRB session with the bundle pre-loaded" + def console(group = nil) + require "bundler/cli/console" + Console.new(options, group).run + end end desc "version", "Prints the bundler's version information" diff --git a/lib/bundler/feature_flag.rb b/lib/bundler/feature_flag.rb index f2671015b3..318ad5dee7 100644 --- a/lib/bundler/feature_flag.rb +++ b/lib/bundler/feature_flag.rb @@ -28,6 +28,7 @@ module Bundler settings_flag(:allow_bundler_dependency_conflicts) { bundler_2_mode? } settings_flag(:allow_offline_install) { bundler_2_mode? } + settings_flag(:console_command) { !bundler_2_mode? } settings_flag(:disable_multisource) { bundler_2_mode? } settings_flag(:error_on_stderr) { bundler_2_mode? } settings_flag(:global_gem_cache) { bundler_2_mode? } diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index f131a310b9..8521f8658d 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -12,6 +12,7 @@ module Bundler auto_install cache_all cache_all_platforms + console_command disable_checksum_validation disable_exec_load disable_local_branch_check diff --git a/spec/commands/console_spec.rb b/spec/commands/console_spec.rb index a854e6228d..9bf66e8f5b 100644 --- a/spec/commands/console_spec.rb +++ b/spec/commands/console_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -RSpec.describe "bundle console" do +RSpec.describe "bundle console", :bundler => "< 2" do before :each do install_gemfile <<-G source "file://#{gem_repo1}" diff --git a/spec/other/platform_spec.rb b/spec/other/platform_spec.rb index 668170a530..4e251cbb0b 100644 --- a/spec/other/platform_spec.rb +++ b/spec/other/platform_spec.rb @@ -908,7 +908,7 @@ G end end - context "bundle console" do + context "bundle console", :bundler => "< 2" do before do install_gemfile <<-G source "file://#{gem_repo1}" diff --git a/spec/quality_spec.rb b/spec/quality_spec.rb index bbdaa8b30d..694bc7efc3 100644 --- a/spec/quality_spec.rb +++ b/spec/quality_spec.rb @@ -169,6 +169,7 @@ RSpec.describe "The library itself" do it "documents all used settings" do exemptions = %w[ + console_command default_cli_command gem.coc gem.mit |