aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-02-23 21:47:34 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-02-23 21:47:34 +0000
commit09993a60737aa642a47bd5047dd53f85a5c0120d (patch)
tree04686da86173c3a410eef07628af12059d97e513 /railties
parent5a02ee2bd8bbaffde71da39de850ed8ea5e66dbc (diff)
downloadrails-09993a60737aa642a47bd5047dd53f85a5c0120d.tar.gz
rails-09993a60737aa642a47bd5047dd53f85a5c0120d.tar.bz2
rails-09993a60737aa642a47bd5047dd53f85a5c0120d.zip
Allow script/server -c /path/to/lighttpd.conf
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3641 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties')
-rw-r--r--railties/CHANGELOG2
-rw-r--r--railties/lib/commands/servers/lighttpd.rb12
2 files changed, 13 insertions, 1 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG
index ca4f75eb1f..bb4b1d127d 100644
--- a/railties/CHANGELOG
+++ b/railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Allow script/server -c /path/to/lighttpd.conf [Jeremy Kemper]
+
* Remove hardcoded path to reaper script in script/server [Jeremy Kemper]
* Update script.aculo.us to V1.5.3 [Thomas Fuchs]
diff --git a/railties/lib/commands/servers/lighttpd.rb b/railties/lib/commands/servers/lighttpd.rb
index 96304a75c1..4c226c2700 100644
--- a/railties/lib/commands/servers/lighttpd.rb
+++ b/railties/lib/commands/servers/lighttpd.rb
@@ -12,10 +12,20 @@ end
require 'initializer'
configuration = Rails::Initializer.run(:initialize_logger).configuration
+default_config_file = config_file = "#{RAILS_ROOT}/config/lighttpd.conf"
-config_file = "#{RAILS_ROOT}/config/lighttpd.conf"
+require 'optparse'
+ARGV.options do |opt|
+ opt.on('-c', "--config=#{config_file}", 'Specify a different lighttpd config file.') { |path| config_file = path }
+ opt.on('-h', '--help', 'Show this message.') { puts opt; exit 0 }
+ opt.parse!
+end
unless File.exist?(config_file)
+ if config_file != default_config_file
+ puts "=> #{config_file} not found."
+ exit 1
+ end
require 'fileutils'
source = File.expand_path(File.join(File.dirname(__FILE__),
"..", "..", "..", "configs", "lighttpd.conf"))