X-Git-Url: http://git.sourceforge.jp/view?p=shogi-server%2Fshogi-server.git;a=blobdiff_plain;f=mk_game_results;h=0da4ace49e598619fb369e05208a8e4d135dafbe;hp=432cf4641cb850a6cbbc192addc26d42f300720e;hb=20131215;hpb=3fd7581aa67b00db3637fc21a2ff865581173988;ds=sidebyside diff --git a/mk_game_results b/mk_game_results index 432cf46..0da4ace 100755 --- a/mk_game_results +++ b/mk_game_results @@ -1,11 +1,11 @@ -#!/usr/bin/ruby +#!/usr/bin/ruby1.9.1 # $Id$ # # Author:: Daigo Moriwaki # Homepage:: http://sourceforge.jp/projects/shogi-server/ # #-- -# Copyright (C) 2009 Daigo Moriwaki +# Copyright (C) 2009-2012 Daigo Moriwaki # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -35,9 +35,9 @@ # # Sample Command lines that isntall prerequires will work on Debian. # -# * Ruby 1.8.7 +# * Ruby 1.9.3 or 1.8.7 # -# $ sudo aptitude install ruby1.8 +# $ sudo aptitude install ruby1.9.1 # # == 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