Skip to content

Commit

Permalink
Don't generate public/dispatch.cgi/fcgi/rb files by default.
Browse files Browse the repository at this point in the history
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
  • Loading branch information
yaroslav authored and lifo committed Nov 24, 2008
1 parent 835be0c commit 5b5730c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions railties/CHANGELOG
@@ -1,5 +1,7 @@
*2.3.0 [Edge]*

* "rails <app>" will not generate public/dispatch.cgi/fcgi/rb files by default now. Please use "--with-dispatches" option if you need them. [Yaroslav Markin, Pratik Naik]

* Added rake rails:update:application_controller to renamed application.rb to application_controller.rb -- included in rake rails:update so upgrading to 2.3 will automatically trigger it #1439 [kastner]

* Added Rails.backtrace_cleaner as an accessor for the Rails::BacktraceCleaner instance used by the framework to cut down on backtrace noise and config/initializers/backtrace_silencers.rb to add your own (or turn them all off) [DHH]
Expand Down
Expand Up @@ -10,7 +10,7 @@ class AppGenerator < Rails::Generator::Base
DEFAULT_DATABASE = 'sqlite3'

default_options :db => (ENV["RAILS_DEFAULT_DATABASE"] || DEFAULT_DATABASE),
:shebang => DEFAULT_SHEBANG, :freeze => false
:shebang => DEFAULT_SHEBANG, :with_dispatches => false, :freeze => false
mandatory_options :source => "#{File.dirname(__FILE__)}/../../../../.."

def initialize(runtime_args, runtime_options = {})
Expand Down Expand Up @@ -83,9 +83,11 @@ def manifest
end

# Dispatches
m.file "dispatches/dispatch.rb", "public/dispatch.rb", dispatcher_options
m.file "dispatches/dispatch.rb", "public/dispatch.cgi", dispatcher_options
m.file "dispatches/dispatch.fcgi", "public/dispatch.fcgi", dispatcher_options
if options[:with_dispatches]
m.file "dispatches/dispatch.rb", "public/dispatch.rb", dispatcher_options
m.file "dispatches/dispatch.rb", "public/dispatch.cgi", dispatcher_options
m.file "dispatches/dispatch.fcgi", "public/dispatch.fcgi", dispatcher_options
end

# HTML files
%w(404 422 500 index).each do |file|
Expand Down Expand Up @@ -129,6 +131,10 @@ def add_options!(opt)
"Preconfigure for selected database (options: #{DATABASES.join('/')}).",
"Default: #{DEFAULT_DATABASE}") { |v| options[:db] = v }

opt.on("-D", "--with-dispatches",
"Add CGI/FastCGI/mod_ruby dispatches code to generated application skeleton",
"Default: false") { |v| options[:with_dispatches] = v }

opt.on("-f", "--freeze",
"Freeze Rails in vendor/rails from the gems generating the skeleton",
"Default: false") { |v| options[:freeze] = v }
Expand Down

0 comments on commit 5b5730c

Please sign in to comment.