summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel E. Giddins <segiddins@segiddins.me>2015-11-26 15:52:11 -0600
committerSamuel E. Giddins <segiddins@segiddins.me>2015-11-26 15:52:11 -0600
commit50c9389c077ca4026b478dec1e812abdafe1118d (patch)
tree75d76bd23d2af295926b68f382d0af34ce5d9784
parent181f11bde3805cfcf6ba55babb608602a403ea40 (diff)
parent5cc527bb9c9908d423f66350c38285ff70974827 (diff)
downloadbundler-1-99-dev.tar.gz
Merge pull request #4028 from Zorbash/deprecate_console_command1-99-dev
Show deprecation warning when using console command
-rw-r--r--lib/bundler/cli/console.rb4
-rw-r--r--spec/commands/console_spec.rb8
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/bundler/cli/console.rb b/lib/bundler/cli/console.rb
index 7c7010e7cf..c0ced54be2 100644
--- a/lib/bundler/cli/console.rb
+++ b/lib/bundler/cli/console.rb
@@ -7,6 +7,10 @@ module Bundler
end
def run
+ Bundler.ui.deprecate "bundle console is deprecated and will be replaced " \
+ "by `bin/console` generated by `bundle gem <name>` " \
+ "in Bundler 2.0.", true
+
group ? Bundler.require(:default, *(group.split.map!(&:to_sym))) : Bundler.require
ARGV.clear
diff --git a/spec/commands/console_spec.rb b/spec/commands/console_spec.rb
index f26fbcdba5..395dd259d2 100644
--- a/spec/commands/console_spec.rb
+++ b/spec/commands/console_spec.rb
@@ -10,6 +10,14 @@ describe "bundle console" do
G
end
+ it "prints a deprecation warning" do
+ bundle "console"
+
+ expect(err).to include('bundle console is deprecated and will be replaced ' \
+ 'by `bin/console` generated by `bundle gem <name>` ' \
+ 'in Bundler 2.0.')
+ end
+
it "starts IRB with the default group loaded" do
bundle "console" do |input|
input.puts("puts RACK")