Permalink
Browse files

added provisory command line switch for specifying custom config file

  • Loading branch information...
1 parent 1fb5b09 commit b7da3f2a48c473f770ea0ce494207799603aabfd @zuk zuk committed Aug 3, 2011
Showing with 16 additions and 2 deletions.
  1. +16 −2 bin/rubycas-server
View
@@ -1,16 +1,30 @@
#!/usr/bin/env ruby
-# Enables UTF-8 compatibility.
+# Enables UTF-8 compatibility in ruby 1.8.
$KCODE = 'u' if RUBY_VERSION < '1.9'
require 'rubygems'
$:.unshift File.dirname(__FILE__) + "/../lib"
if ARGV.join.match('--debugger')
- require 'ruby-debug'
+ require 'ruby-debug'
+ puts
puts "=> Debugger Enabled"
end
+
+if ARGV.join.match('-c')
+ c = ARGV.join.match(/-c\s*([^\s]+)/)
+ if (c && c[1])
+ ENV['CONFIG_FILE'] = c[1]
+ puts
+ puts "=> Using custom config file #{ENV['CONFIG_FILE'].inspect}"
+ else
+ $stderr.puts("To specify a custom config file use `rubycas-server -c path/to/config_file_name.yml`.")
+ exit
+ end
+end
+
require 'casserver'
CASServer::Server.run!

0 comments on commit b7da3f2

Please sign in to comment.