aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2006-11-19 21:12:22 +0000
committerRick Olson <technoweenie@gmail.com>2006-11-19 21:12:22 +0000
commit5999fdd3f30c64e340b64be1a64aa16323c6c69e (patch)
tree141f568dc04c5033e6acd79e332c2c629bc334ab /railties/lib
parentca2d704c75121fa15fc7bed642139daf15039de3 (diff)
downloadrails-5999fdd3f30c64e340b64be1a64aa16323c6c69e.tar.gz
rails-5999fdd3f30c64e340b64be1a64aa16323c6c69e.tar.bz2
rails-5999fdd3f30c64e340b64be1a64aa16323c6c69e.zip
Use custom mime file for script/server mongrel if config/mime.yml exists. Pass --mime=other/path for a custom mime file. [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5572 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/commands/servers/mongrel.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/railties/lib/commands/servers/mongrel.rb b/railties/lib/commands/servers/mongrel.rb
index 98441aca91..6e401adba2 100644
--- a/railties/lib/commands/servers/mongrel.rb
+++ b/railties/lib/commands/servers/mongrel.rb
@@ -14,14 +14,18 @@ require 'optparse'
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 @@ end
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'