#!/usr/local/bin/ruby require 'rubygems' require 'cgi' require 'GINA' begin require 'dbi' cgi=CGI.new("html3") web_conf = GINA::load_config("l5_tracker/coverage.yml") conf = GINA::load_config("l5_tracker/database.yml") dbh = DBI.connect(conf['production']['dbi_connector'] , conf['production']['username'], conf['production']['password']) out = [] start_tm = Time.gm(Time.now().year, Time.now().month, Time.now().day, 0,0,0,0) sql = "select distinct " + " region " + " from " + " afs_basedata.firezone " + " order by " + " region " sth = dbh.prepare(sql) sth.execute out << "" out << " " out << "
" out << "" cgi.out { cgi.head { cgi.title{ web_conf['web']['title'] } + "" + ""} + cgi.body { out.join("\n") } } exit(1) catch StandardError => e cgi= CGI.new("html3"); cgi.out { cgi.head { cgi.title{"Sadness.. Something not good has happened.."} } + cgi.html { "Something bad has happened.. Perhaps it is this: #{e.to_s} " +
" or #{e.backtrace}"
}
}
exit(-1);
end