summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitris Zorbas <zorbash@skroutz.gr>2015-10-03 13:25:00 +0300
committerDimitris Zorbas <zorbash@skroutz.gr>2015-11-08 19:28:24 +0200
commit5cc527bb9c9908d423f66350c38285ff70974827 (patch)
tree75d76bd23d2af295926b68f382d0af34ce5d9784
parent181f11bde3805cfcf6ba55babb608602a403ea40 (diff)
downloadbundler-5cc527bb9c9908d423f66350c38285ff70974827.tar.gz
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")