diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-09-25 21:10:00 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-09-25 21:10:00 -0500 |
commit | 382870f763d8f51a49d3379cf5f3e93d59ab1abf (patch) | |
tree | 330323af82362d829ea41de3b10b7960e154a04d /railties/lib/rails/commands | |
parent | f14ad4145622f45e9bf7433b5fdef4ce427efe4b (diff) | |
download | rails-382870f763d8f51a49d3379cf5f3e93d59ab1abf.tar.gz rails-382870f763d8f51a49d3379cf5f3e93d59ab1abf.tar.bz2 rails-382870f763d8f51a49d3379cf5f3e93d59ab1abf.zip |
Generate a config.ru stub
Diffstat (limited to 'railties/lib/rails/commands')
-rw-r--r-- | railties/lib/rails/commands/server.rb | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/railties/lib/rails/commands/server.rb b/railties/lib/rails/commands/server.rb index 823916b1dc..54d512dd67 100644 --- a/railties/lib/rails/commands/server.rb +++ b/railties/lib/rails/commands/server.rb @@ -60,21 +60,16 @@ end ENV["RAILS_ENV"] = options[:environment] RAILS_ENV.replace(options[:environment]) if defined?(RAILS_ENV) -if File.exist?(options[:config]) - config = options[:config] - if config =~ /\.ru$/ - cfgfile = File.read(config) - if cfgfile[/^#\\(.*)/] - opts.parse!($1.split(/\s+/)) - end - inner_app = eval("Rack::Builder.new {( " + cfgfile + "\n )}.to_app", nil, config) - else - require config - inner_app = Object.const_get(File.basename(config, '.rb').capitalize) +config = options[:config] +if config =~ /\.ru$/ + cfgfile = File.read(config) + if cfgfile[/^#\\(.*)/] + opts.parse!($1.split(/\s+/)) end + inner_app = eval("Rack::Builder.new {( " + cfgfile + "\n )}.to_app", nil, config) else - require RAILS_ROOT + "/config/environment" - inner_app = ActionController::Dispatcher.new + require config + inner_app = Object.const_get(File.basename(config, '.rb').capitalize) end if options[:path].nil? |