Permalink
Browse files

Allow script/server -c /path/to/lighttpd.conf

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3641 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 5a02ee2 commit 09993a60737aa642a47bd5047dd53f85a5c0120d @jeremy jeremy committed Feb 23, 2006
Showing with 13 additions and 1 deletion.
  1. +2 −0 railties/CHANGELOG
  2. +11 −1 railties/lib/commands/servers/lighttpd.rb
View
@@ -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]
@@ -12,10 +12,20 @@
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"))

0 comments on commit 09993a6

Please sign in to comment.