public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Don't generate public/dispatch.cgi/fcgi/rb files by default.

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
yaroslav (author)
Mon Nov 24 10:22:04 -0800 2008
lifo (committer)
Mon Nov 24 10:31:58 -0800 2008
commit  5b5730cc6e9194fb5f67fe79d2c7849e200ba6ed
tree    cb9a185ef246405decb2cb67f1f5d3770166840a
parent  835be0cbedd56bb4af71f1104d311d0e425e7abf
...
1
2
 
 
3
4
5
...
1
2
3
4
5
6
7
0
@@ -1,5 +1,7 @@
0
 *2.3.0 [Edge]*
0
 
0
+* "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]
0
+
0
 * 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]
0
 
0
 * 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]
...
10
11
12
13
 
14
15
16
...
83
84
85
86
87
88
 
 
 
 
 
89
90
91
...
129
130
131
 
 
 
 
132
133
134
...
10
11
12
 
13
14
15
16
...
83
84
85
 
 
 
86
87
88
89
90
91
92
93
...
131
132
133
134
135
136
137
138
139
140
0
@@ -10,7 +10,7 @@ class AppGenerator < Rails::Generator::Base
0
   DEFAULT_DATABASE = 'sqlite3'
0
 
0
   default_options   :db => (ENV["RAILS_DEFAULT_DATABASE"] || DEFAULT_DATABASE),
0
-    :shebang => DEFAULT_SHEBANG, :freeze => false
0
+    :shebang => DEFAULT_SHEBANG, :with_dispatches => false, :freeze => false
0
   mandatory_options :source => "#{File.dirname(__FILE__)}/../../../../.."
0
 
0
   def initialize(runtime_args, runtime_options = {})
0
@@ -83,9 +83,11 @@ class AppGenerator < Rails::Generator::Base
0
       end
0
 
0
       # Dispatches
0
-      m.file "dispatches/dispatch.rb",   "public/dispatch.rb", dispatcher_options
0
-      m.file "dispatches/dispatch.rb",   "public/dispatch.cgi", dispatcher_options
0
-      m.file "dispatches/dispatch.fcgi", "public/dispatch.fcgi", dispatcher_options
0
+      if options[:with_dispatches]
0
+        m.file "dispatches/dispatch.rb",   "public/dispatch.rb", dispatcher_options
0
+        m.file "dispatches/dispatch.rb",   "public/dispatch.cgi", dispatcher_options
0
+        m.file "dispatches/dispatch.fcgi", "public/dispatch.fcgi", dispatcher_options
0
+      end
0
 
0
       # HTML files
0
       %w(404 422 500 index).each do |file|
0
@@ -129,6 +131,10 @@ class AppGenerator < Rails::Generator::Base
0
             "Preconfigure for selected database (options: #{DATABASES.join('/')}).",
0
             "Default: #{DEFAULT_DATABASE}") { |v| options[:db] = v }
0
 
0
+      opt.on("-D", "--with-dispatches",
0
+            "Add CGI/FastCGI/mod_ruby dispatches code to generated application skeleton",
0
+            "Default: false") { |v| options[:with_dispatches] = v }
0
+
0
       opt.on("-f", "--freeze",
0
             "Freeze Rails in vendor/rails from the gems generating the skeleton",
0
             "Default: false") { |v| options[:freeze] = v }

Comments