aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/commands/server.rb
diff options
context:
space:
mode:
authorDavid Rodríguez de Dios <deivid.rodriguez@gmail.com>2014-04-08 20:55:23 +0200
committerDavid Rodríguez de Dios <deivid.rodriguez@gmail.com>2014-04-08 20:55:23 +0200
commit7901ae13a1d8187c1b620b51df7d840818fd759d (patch)
tree23aa668fe744dad54b3f2bbd787726aff00c60ec /railties/lib/rails/commands/server.rb
parent75e0ee861f78d6b76ca8d6f7bf74b9dc1ca03bc3 (diff)
downloadrails-7901ae13a1d8187c1b620b51df7d840818fd759d.tar.gz
rails-7901ae13a1d8187c1b620b51df7d840818fd759d.tar.bz2
rails-7901ae13a1d8187c1b620b51df7d840818fd759d.zip
Keep debugger support only for rubies < 2.0.0
Diffstat (limited to 'railties/lib/rails/commands/server.rb')
-rw-r--r--railties/lib/rails/commands/server.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/railties/lib/rails/commands/server.rb b/railties/lib/rails/commands/server.rb
index fec4962fb5..6146b6c1db 100644
--- a/railties/lib/rails/commands/server.rb
+++ b/railties/lib/rails/commands/server.rb
@@ -18,7 +18,14 @@ module Rails
opts.on("-c", "--config=file", String,
"Use custom rackup configuration file") { |v| options[:config] = v }
opts.on("-d", "--daemon", "Make server run as a Daemon.") { options[:daemonize] = true }
- opts.on("-u", "--debugger", "Enable the debugger") { options[:debugger] = true }
+ opts.on("-u", "--debugger", "Enable the debugger") do
+ if RUBY_VERSION < '2.0.0'
+ options[:debugger] = true
+ else
+ puts "=> Notice: debugger option is ignored since ruby 2.0 and " \
+ "it will be removed in future versions"
+ end
+ end
opts.on("-e", "--environment=name", String,
"Specifies the environment to run this server under (test/development/production).",
"Default: development") { |v| options[:environment] = v }
@@ -75,7 +82,9 @@ module Rails
def middleware
middlewares = []
- middlewares << [Rails::Rack::Debugger] if options[:debugger]
+ if RUBY_VERSION < '2.0.0'
+ middlewares << [Rails::Rack::Debugger] if options[:debugger]
+ end
middlewares << [::Rack::ContentLength]
# FIXME: add Rack::Lock in the case people are using webrick.