Skip to content
Browse files

merge [5571] and [5572] from trunk

git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/1-2-pre-release@5573 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 9ba9677 commit 30e5436a3eed27da8f433a452125736ac3ab7b03 @technoweenie technoweenie committed Nov 19, 2006
View
4 railties/CHANGELOG
@@ -1,5 +1,9 @@
*1.2.0 RC1* (November 8th, 2006)
+* Use custom mime file for script/server mongrel if config/mime.yml exists. Pass --mime=other/path for a custom mime file. [Rick Olson]
+
+* Add custom mime type file for mongrel. config/mime.yml is added with generated apps from the rails command. [Rick Olson]
+
* Update to Prototype 1.5.0_rc2 [5550] which makes it work in Opera again [Thomas Fuchs]
* Make sure that exceptions which are thrown outside of the user code try their best to be handeled in ApplicationController#rescue_action [Tobias Luetke]
View
10 railties/lib/commands/servers/mongrel.rb
@@ -14,14 +14,18 @@
detach = false
ip = nil
port = nil
+mime = 'config/mime.yml'
ARGV.clone.options do |opt|
opt.on("-p", "--port=port", Integer,
"Runs Rails on the specified port.",
"Default: 3000") { |p| port = p }
- opt.on("-a", "--binding=ip", String,
+ opt.on("-a", "--address=ip", String,
"Binds Rails to the specified ip.",
"Default: 0.0.0.0") { |i| ip = i }
+ opt.on("-m", "--mime=path", String,
+ "Path to custom mime file.",
+ "Default: config/mime.yml (if it exists)") { |m| mime = m }
opt.on('-h', '--help', 'Show this message.') { puts opt; exit 0 }
opt.on('-d', '-d', 'Call with -d to detach') { detach = true }
opt.parse!
@@ -43,6 +47,10 @@
trap(:INT) { exit }
+if File.exist?(File.join(RAILS_ROOT, mime)) && !ARGV.any? { |a| a =~ /^--?m/ }
+ ARGV << "--mime=#{mime}"
+end
+
begin
ARGV.unshift("start")
load 'mongrel_rails'
View
1 railties/lib/rails_generator/generators/applications/app/app_generator.rb
@@ -41,6 +41,7 @@ def manifest
:app_name => @app_name,
:socket => options[:db] == "mysql" ? mysql_socket_location : nil
}
+ m.template "configs/mime.yml", "config/mime.yml"
m.template "configs/routes.rb", "config/routes.rb"
m.template "configs/apache.conf", "public/.htaccess"

0 comments on commit 30e5436

Please sign in to comment.
Something went wrong with that request. Please try again.