diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-12-03 10:32:30 -0600 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-12-03 10:32:30 -0600 |
commit | 99f2cb4918786382413bdd29b3cacfd5b9377677 (patch) | |
tree | 9279a5f1b63a03f51b1a04734a4c70bb6b6c3546 /railties/lib/commands/server.rb | |
parent | 0b4858cf38f522208381f9bfbbb5c066aceb30d2 (diff) | |
parent | 1e1056f6435254c81f02fd0fba53d9356050cb00 (diff) | |
download | rails-99f2cb4918786382413bdd29b3cacfd5b9377677.tar.gz rails-99f2cb4918786382413bdd29b3cacfd5b9377677.tar.bz2 rails-99f2cb4918786382413bdd29b3cacfd5b9377677.zip |
Merge branch 'master' of git@github.com:rails/rails
Diffstat (limited to 'railties/lib/commands/server.rb')
-rw-r--r-- | railties/lib/commands/server.rb | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/railties/lib/commands/server.rb b/railties/lib/commands/server.rb index a4bb52592f..7057fcc33f 100644 --- a/railties/lib/commands/server.rb +++ b/railties/lib/commands/server.rb @@ -65,7 +65,6 @@ end ENV["RAILS_ENV"] = options[:environment] RAILS_ENV.replace(options[:environment]) if defined?(RAILS_ENV) -require RAILS_ROOT + "/config/environment" if File.exist?(options[:config]) config = options[:config] @@ -74,20 +73,23 @@ if File.exist?(options[:config]) if cfgfile[/^#\\(.*)/] opts.parse!($1.split(/\s+/)) end - app = eval("Rack::Builder.new {( " + cfgfile + "\n )}.to_app", nil, config) + inner_app = eval("Rack::Builder.new {( " + cfgfile + "\n )}.to_app", nil, config) else require config - app = Object.const_get(File.basename(config, '.rb').capitalize) + inner_app = Object.const_get(File.basename(config, '.rb').capitalize) end else - app = Rack::Builder.new { - use Rails::Rack::Logger - use Rails::Rack::Static - use Rails::Rack::Debugger if options[:debugger] - run ActionController::Dispatcher.new - }.to_app + require RAILS_ROOT + "/config/environment" + inner_app = ActionController::Dispatcher.new end +app = Rack::Builder.new { + use Rails::Rack::Logger + use Rails::Rack::Static + use Rails::Rack::Debugger if options[:debugger] + run inner_app +}.to_app + puts "=> Call with -d to detach" trap(:INT) { exit } |