aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/commands/console.rb
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2012-02-01 08:59:21 +0100
committerPiotr Sarnacki <drogus@gmail.com>2012-02-16 20:41:34 +0100
commit951b58206255791587e2491435a80cf0ab3b797b (patch)
tree7f4618f8ebb57a197b187c56ead4f512288815bd /railties/lib/rails/commands/console.rb
parente09ac7086b88da0b578c5f4851b6a10db8bfc5fb (diff)
downloadrails-951b58206255791587e2491435a80cf0ab3b797b.tar.gz
rails-951b58206255791587e2491435a80cf0ab3b797b.tar.bz2
rails-951b58206255791587e2491435a80cf0ab3b797b.zip
Allow to set custom console type with Rails.application.config.console=
This patch adds ability to set custom console if you want to use something other than IRB. Previously the hack that people used was: silence_warnings do require 'pry' IRB = Pry end which is not the best way to customize things.
Diffstat (limited to 'railties/lib/rails/commands/console.rb')
-rw-r--r--railties/lib/rails/commands/console.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/railties/lib/rails/commands/console.rb b/railties/lib/rails/commands/console.rb
index 432c81af88..e2956bbef6 100644
--- a/railties/lib/rails/commands/console.rb
+++ b/railties/lib/rails/commands/console.rb
@@ -42,8 +42,9 @@ module Rails
puts "Loading #{Rails.env} environment (Rails #{Rails.version})"
end
- IRB::ExtendCommandBundle.send :include, Rails::ConsoleMethods
- IRB.start
+ console = Rails.application.config.console || IRB
+ console::ExtendCommandBundle.send :include, Rails::ConsoleMethods
+ console.start
end
end
end