Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
added provisory command line switch for specifying custom config file
  • Loading branch information
zuk committed Aug 3, 2011
1 parent 1fb5b09 commit b7da3f2
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions bin/rubycas-server
@@ -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.