diff options
Diffstat (limited to 'railties/lib/commands/servers/mongrel.rb')
-rw-r--r-- | railties/lib/commands/servers/mongrel.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/railties/lib/commands/servers/mongrel.rb b/railties/lib/commands/servers/mongrel.rb index 995274f9a0..5eb14bce1e 100644 --- a/railties/lib/commands/servers/mongrel.rb +++ b/railties/lib/commands/servers/mongrel.rb @@ -12,13 +12,15 @@ OPTIONS = { :port => 3000, :ip => "0.0.0.0", :environment => (ENV['RAILS_ENV'] || "development").dup, - :detach => false + :detach => false, + :debugger => false } ARGV.clone.options do |opts| opts.on("-p", "--port=port", Integer, "Runs Rails on the specified port.", "Default: 3000") { |v| OPTIONS[:port] = v } opts.on("-b", "--binding=ip", String, "Binds Rails to the specified ip.", "Default: 0.0.0.0") { |v| OPTIONS[:ip] = v } opts.on("-d", "--daemon", "Make server run as a Daemon.") { OPTIONS[:detach] = true } + opts.on("-u", "--debugger", "Enable ruby-debugging for the server.") { OPTIONS[:debugger] = true } opts.on("-e", "--environment=name", String, "Specifies the environment to run this server under (test/development/production).", "Default: development") { |v| OPTIONS[:environment] = v } @@ -46,6 +48,8 @@ else ENV["RAILS_ENV"] = OPTIONS[:environment] RAILS_ENV.replace(OPTIONS[:environment]) if defined?(RAILS_ENV) + start_debugger if OPTIONS[:debugger] + require 'initializer' Rails::Initializer.run(:initialize_logger) |