Skip to content
This repository
Browse code

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...
commit 30e5436a3eed27da8f433a452125736ac3ab7b03 1 parent 9ba9677
risk danger olson technoweenie authored
4 railties/CHANGELOG
... ... @@ -1,5 +1,9 @@
1 1 *1.2.0 RC1* (November 8th, 2006)
2 2
  3 +* Use custom mime file for script/server mongrel if config/mime.yml exists. Pass --mime=other/path for a custom mime file. [Rick Olson]
  4 +
  5 +* Add custom mime type file for mongrel. config/mime.yml is added with generated apps from the rails command. [Rick Olson]
  6 +
3 7 * Update to Prototype 1.5.0_rc2 [5550] which makes it work in Opera again [Thomas Fuchs]
4 8
5 9 * Make sure that exceptions which are thrown outside of the user code try their best to be handeled in ApplicationController#rescue_action [Tobias Luetke]
10 railties/lib/commands/servers/mongrel.rb
@@ -14,14 +14,18 @@
14 14 detach = false
15 15 ip = nil
16 16 port = nil
  17 +mime = 'config/mime.yml'
17 18
18 19 ARGV.clone.options do |opt|
19 20 opt.on("-p", "--port=port", Integer,
20 21 "Runs Rails on the specified port.",
21 22 "Default: 3000") { |p| port = p }
22   - opt.on("-a", "--binding=ip", String,
  23 + opt.on("-a", "--address=ip", String,
23 24 "Binds Rails to the specified ip.",
24 25 "Default: 0.0.0.0") { |i| ip = i }
  26 + opt.on("-m", "--mime=path", String,
  27 + "Path to custom mime file.",
  28 + "Default: config/mime.yml (if it exists)") { |m| mime = m }
25 29 opt.on('-h', '--help', 'Show this message.') { puts opt; exit 0 }
26 30 opt.on('-d', '-d', 'Call with -d to detach') { detach = true }
27 31 opt.parse!
@@ -43,6 +47,10 @@
43 47
44 48 trap(:INT) { exit }
45 49
  50 +if File.exist?(File.join(RAILS_ROOT, mime)) && !ARGV.any? { |a| a =~ /^--?m/ }
  51 + ARGV << "--mime=#{mime}"
  52 +end
  53 +
46 54 begin
47 55 ARGV.unshift("start")
48 56 load 'mongrel_rails'
1  railties/lib/rails_generator/generators/applications/app/app_generator.rb
@@ -41,6 +41,7 @@ def manifest
41 41 :app_name => @app_name,
42 42 :socket => options[:db] == "mysql" ? mysql_socket_location : nil
43 43 }
  44 + m.template "configs/mime.yml", "config/mime.yml"
44 45 m.template "configs/routes.rb", "config/routes.rb"
45 46 m.template "configs/apache.conf", "public/.htaccess"
46 47

0 comments on commit 30e5436

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