diff options
author | Yaroslav Markin <yaroslav@markin.net> | 2008-11-24 19:22:04 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-11-24 19:31:58 +0100 |
commit | 5b5730cc6e9194fb5f67fe79d2c7849e200ba6ed (patch) | |
tree | cb9a185ef246405decb2cb67f1f5d3770166840a /railties/lib/rails_generator | |
parent | 835be0cbedd56bb4af71f1104d311d0e425e7abf (diff) | |
download | rails-5b5730cc6e9194fb5f67fe79d2c7849e200ba6ed.tar.gz rails-5b5730cc6e9194fb5f67fe79d2c7849e200ba6ed.tar.bz2 rails-5b5730cc6e9194fb5f67fe79d2c7849e200ba6ed.zip |
Don't generate public/dispatch.cgi/fcgi/rb files by default.
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'railties/lib/rails_generator')
-rw-r--r-- | railties/lib/rails_generator/generators/applications/app/app_generator.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/railties/lib/rails_generator/generators/applications/app/app_generator.rb b/railties/lib/rails_generator/generators/applications/app/app_generator.rb index e52dcadd4d..892dba20b0 100644 --- a/railties/lib/rails_generator/generators/applications/app/app_generator.rb +++ b/railties/lib/rails_generator/generators/applications/app/app_generator.rb @@ -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 = {}) @@ -83,9 +83,11 @@ class AppGenerator < Rails::Generator::Base 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| @@ -129,6 +131,10 @@ class AppGenerator < Rails::Generator::Base "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 } |