Class interface to config data.
Singleton
# File util/config.rb, line 70
def initialize()
Config.init()
end
Class method to read configuration file.
# File util/config.rb, line 75
def self.init()
begin
Kernel.load CONFFILE
rescue Exception => e
STDERR.puts("Error loading \"#{CONFFILE}\":\n#{e.message}")
exit(1)
end
end
Return hash of programs to start, keyed by hostname.
# File util/config.rb, line 84
def start()
get(:START)
end
Return hash of database parameters.
# File util/config.rb, line 88
def db()
get(:DB)
end
Return hash of backend programs and their configuration data.
# File util/config.rb, line 92
def backend()
get(:BACKEND)
end
Return hash of location and port to contact server daemon.
# File util/config.rb, line 96
def named()
get(:NAMED)
end
Retrieve configuration item by symbol.
# File util/config.rb, line 103
def get(name)
JukeboxConf.const_defined?(name) ? JukeboxConf.const_get(name) : nil
end