From 6fae9ac58147948474c3fa472f0eb04525737d45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez=20de=20Dios?= Date: Thu, 10 Apr 2014 16:02:13 +0200 Subject: Isolate debugger related code --- railties/lib/rails/commands/console.rb | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'railties/lib') diff --git a/railties/lib/rails/commands/console.rb b/railties/lib/rails/commands/console.rb index fdc8662bcd..555d8f31e1 100644 --- a/railties/lib/rails/commands/console.rb +++ b/railties/lib/rails/commands/console.rb @@ -76,9 +76,19 @@ module Rails Rails.env = environment end - def debugger? - options[:debugger] - end if RUBY_VERSION < '2.0.0' + if RUBY_VERSION < '2.0.0' + def debugger? + options[:debugger] + end + + def require_debugger + require 'debugger' + puts "=> Debugger enabled" + rescue LoadError + puts "You're missing the 'debugger' gem. Add it to your Gemfile, bundle it and try again." + exit(1) + end + end def start if RUBY_VERSION < '2.0.0' @@ -99,13 +109,5 @@ module Rails end console.start end - - def require_debugger - require 'debugger' - puts "=> Debugger enabled" - rescue LoadError - puts "You're missing the 'debugger' gem. Add it to your Gemfile, bundle it and try again." - exit(1) - end if RUBY_VERSION < '2.0.0' end end -- cgit v1.2.3