X-Git-Url: http://git.sourceforge.jp/view?p=shogi-server%2Fshogi-server.git;a=blobdiff_plain;f=mk_game_results;h=0260f88fd63d68bb8f4e4817b185ae714f607dcb;hp=6b205a23c133f3b48b2d64e7054170dcd144c28b;hb=7f8ed35561592e0359c9ac2779b53832ed7943b9;hpb=667a321f5d24db2988534d6c5bbfb4a015bbe10d diff --git a/mk_game_results b/mk_game_results index 6b205a2..0260f88 100755 --- a/mk_game_results +++ b/mk_game_results @@ -1,4 +1,4 @@ -#!/usr/bin/ruby1.9.1 +#!/usr/bin/ruby # $Id$ # # Author:: Daigo Moriwaki @@ -35,9 +35,9 @@ # # Sample Command lines that isntall prerequires will work on Debian. # -# * Ruby 1.9.3 or 1.8.7 +# * Ruby 2.0.0 or later # -# $ sudo aptitude install ruby1.9.1 +# $ sudo aptitude install ruby # # == Run # @@ -58,7 +58,11 @@ require 'getoptlong' # @parameter file an absolute path of a csa file # def grep(file) - str = File.open(file).read + if RUBY_VERSION >= "1.9.1" + str = File.open(file, "r:EUC-JP").read + else + str = File.open(file, "r").read + end if /^N\+(.*)$/ =~ str then black_name = $1.strip end if /^N\-(.*)$/ =~ str then white_name = $1.strip end @@ -89,6 +93,7 @@ def grep(file) puts [time, state, black_mark, black_id, white_id, white_mark, file].join("\t") end end + $stdout.flush end # Show Usage