about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-09-30 23:49:53 -0700
committerEric Wong <normalperson@yhbt.net>2009-09-30 23:49:53 -0700
commit6befcbc2457f6d6eebd836adc08ee34e696588bd (patch)
treec89f815f81038f87de892f31d2be186339377cfe
parente87d9decb82fbbde50926911167fecebd4bcc25e (diff)
downloadunicorn-6befcbc2457f6d6eebd836adc08ee34e696588bd.tar.gz
..but keep -P deprecated.  --path is still useful for testing
ad-hoc changes when you don't want to commit your changes
permanently to a configuration file.
-rw-r--r--Documentation/unicorn_rails.1.txt6
-rwxr-xr-xbin/unicorn_rails12
2 files changed, 14 insertions, 4 deletions
diff --git a/Documentation/unicorn_rails.1.txt b/Documentation/unicorn_rails.1.txt
index a43589c..f612e18 100644
--- a/Documentation/unicorn_rails.1.txt
+++ b/Documentation/unicorn_rails.1.txt
@@ -78,6 +78,12 @@ as much as possible.
     This option only exists for compatibility with the rackup(1) command,
     use of "-l"/"\--listen" switch is recommended instead.
 
+\--path PATH
+:   Mounts the Rails application at the given PATH (instead of "/").
+    This is equivalent to setting the RAILS_RELATIVE_URL_ROOT
+    environment variable.  This is only supported under Rails 2.3
+    or later at the moment.
+
 # RUBY OPTIONS
 -e, \--eval LINE
 :   Evaluate a LINE of Ruby code.  This evaluation happens
diff --git a/bin/unicorn_rails b/bin/unicorn_rails
index ab9f1c0..5ed054d 100755
--- a/bin/unicorn_rails
+++ b/bin/unicorn_rails
@@ -78,10 +78,14 @@ opts = OptionParser.new("", 24, '  ') do |opts|
     options[:config_file] = File.expand_path(f)
   end
 
-  opts.on("-P", "--path PATH", "DEPRECATED") do |v|
-    warn %q{Use of --path/-P is strongly discouraged}
-    warn %q{Use the RAILS_RELATIVE_URL_ROOT environment variable}
-    warn %q{  or the 'map' directive in the rackup config instead}
+  opts.on("-P PATH", "DEPRECATED") do |v|
+    warn %q{Use of -P is ambiguous and discouraged}
+    warn %q{Use --path or RAILS_RELATIVE_URL_ROOT instead}
+    ENV['RAILS_RELATIVE_URL_ROOT'] = v
+  end
+
+  opts.on("--path PATH", "Runs Rails app mounted at a specific path.",
+          "(default: /)") do |v|
     ENV['RAILS_RELATIVE_URL_ROOT'] = v
   end