#!/usr/local/bin/ruby # -*- coding: utf-8 -*- require 'sqlite3' require 'kconv' OPEN=(ENV['OPENING_TIME'] || "") if OPEN > Time.now.strftime("%F %T") puts "Disclosed at #{OPEN}"; exit end dbfile = "vote.sq3" max=(ENV["MKG_MAX"] || "100").to_i team = Hash.new votetbl = "vote.tbl" IO.foreach(votetbl) do |x| x = x.toeuc sname, gname = x.scan(/([-0-9a-z]+)\s+(.*)/i)[0] next unless sname && gname team[sname] = gname end if test(?e, "openat") date = IO.readlines("openat")[0].chomp if Time.now.strftime("%F %T") < date printf("
| " printf("%s (%3d) | \n", team[t], t, point[t]) pt = point[t] print "\n "
#printf ' |