• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

shogi-server source


Commit MetaInfo

Revisão3ffaeead65a729c5d6203eaf2a56050c3269402b (tree)
Hora2014-12-13 16:28:41
AutorDaigo Moriwaki <daigo@debi...>
CommiterDaigo Moriwaki

Mensagem de Log

Merge remote-tracking branch 'origin/wdoor-stable'

Conflicts:
changelog

Mudança Sumário

Diff

--- a/changelog
+++ b/changelog
@@ -1,3 +1,11 @@
1+2014-11-24 Daigo Moriwaki <daigo at debian dot org>
2+
3+ * Ruby 2.0:
4+ - Ruby 2.0.0 or later is recommended to use with shogi-server
5+ since Ruby 1.8 reached its End-of-Life on the end of July, 2014.
6+ * [shogi-server]
7+ - Addressed a warning of duplicated range in a regular expression.
8+
19 2014-10-13 Daigo Moriwaki <daigo at debian dot org>
210
311 * [shogi-server]
--- a/csa-file-filter
+++ b/csa-file-filter
@@ -1,4 +1,4 @@
1-#!/usr/bin/ruby1.9.1
1+#!/usr/bin/ruby
22 # $Id$
33 #
44 # Author:: Daigo Moriwaki
@@ -50,9 +50,9 @@
5050 #
5151 # Sample Command lines that isntall prerequires will work on Debian.
5252 #
53-# * Ruby 1.9.3 or 1.8.7 including RDoc
53+# * Ruby 2.0.0 or later including RDoc
5454 #
55-# $ sudo aptitude install ruby ruby1.9.1
55+# $ sudo aptitude install ruby ruby
5656 #
5757 # == Example
5858 #
--- a/mk_game_results
+++ b/mk_game_results
@@ -1,4 +1,4 @@
1-#!/usr/bin/ruby1.9.1
1+#!/usr/bin/ruby
22 # $Id$
33 #
44 # Author:: Daigo Moriwaki
@@ -35,9 +35,9 @@
3535 #
3636 # Sample Command lines that isntall prerequires will work on Debian.
3737 #
38-# * Ruby 1.9.3 or 1.8.7
38+# * Ruby 2.0.0 or later
3939 #
40-# $ sudo aptitude install ruby1.9.1
40+# $ sudo aptitude install ruby
4141 #
4242 # == Run
4343 #
--- a/mk_html
+++ b/mk_html
@@ -1,4 +1,4 @@
1-#!/usr/bin/ruby1.9.1
1+#!/usr/bin/ruby
22 # $Id$
33 #
44 # Author:: Daigo Moriwaki
@@ -41,9 +41,9 @@
4141 #
4242 # == Prerequire
4343 #
44-# * Ruby 1.9.3 or 1.8.7
44+# * Ruby 2.0.0 or later
4545 #
46-# $ sudo aptitude install ruby ruby1.9.1
46+# $ sudo aptitude install ruby ruby
4747 #
4848 # == Example
4949 #
--- a/mk_rate
+++ b/mk_rate
@@ -1,4 +1,4 @@
1-#!/usr/bin/ruby1.9.1
1+#!/usr/bin/ruby
22 # $Id$
33 #
44 # Author:: Daigo Moriwaki
@@ -76,9 +76,9 @@
7676 #
7777 # Sample Command lines that install prerequires will work on Debian.
7878 #
79-# * Ruby 1.9.3 or 1.8.7 (including Rubygems)
79+# * Ruby 2.0.0 or later (including Rubygems)
8080 #
81-# $ sudo aptitude install ruby1.9.1
81+# $ sudo aptitude install ruby
8282 #
8383 # * Ruby bindings for the GNU Scientific Library (GSL[http://rb-gsl.rubyforge.org/])
8484 #
@@ -86,7 +86,7 @@
8686 #
8787 # * RGL: {Ruby Graph Library}[http://rubyforge.org/projects/rgl/]
8888 #
89-# $ sudo gem1.9.1 install rgl
89+# $ sudo gem install rgl
9090 #
9191 # == Examples
9292 #
--- a/shogi-server
+++ b/shogi-server
@@ -1,4 +1,4 @@
1-#! /usr/bin/ruby1.9.1
1+#! /usr/bin/ruby
22 # $Id$
33 #
44 # Author:: NABEYA Kenichi, Daigo Moriwaki
--- a/shogi-server-profile
+++ b/shogi-server-profile
@@ -1,4 +1,4 @@
1-#! /usr/bin/ruby1.9.1
1+#! /usr/bin/ruby
22 # $Id$
33 #
44 # Author:: Daigo Moriwaki
@@ -38,7 +38,7 @@
3838 #
3939 # * {ruby-prof}[http://rubyforge.org/projects/ruby-prof/]
4040 #
41-# $ sudo gem1.9.1 install ruby-prof
41+# $ sudo gem install ruby-prof
4242 #
4343 # == Run
4444 #
--- a/shogi_server/login.rb
+++ b/shogi_server/login.rb
@@ -79,7 +79,7 @@ class Login
7979 end
8080
8181 def Login.good_identifier?(str)
82- if str =~ /\A[\w\d_@\-\.]{1,#{Max_Identifier_Length}}\z/
82+ if str =~ /\A[\w@\-\.]{1,#{Max_Identifier_Length}}\z/
8383 return true
8484 else
8585 return false
--- a/test/baseclient.rb
+++ b/test/baseclient.rb
@@ -35,21 +35,25 @@ class SocketPlayer
3535
3636 def reader
3737 @thread = Thread.new do
38- Thread.pass
39- loop do
40-# break if @socket.closed?
41- if r = select([@socket], nil, nil, 10)
42- str = r[0].first.gets
43- break if str.nil?
44- @mutex.synchronize do
45- if %r!^[\+\-]\d{4}\w{2},T\d+$! =~ str
46- @received_moves += 1
38+ begin
39+ Thread.pass
40+ loop do
41+ break if @socket.closed?
42+ if r = select([@socket], nil, nil, 10)
43+ str = r[0].first.gets
44+ break if str.nil?
45+ @mutex.synchronize do
46+ if %r!^[\+\-]\d{4}\w{2},T\d+$! =~ str
47+ @received_moves += 1
48+ end
49+ @message << str
4750 end
48- @message << str
51+ else
52+ raise "timed out"
4953 end
50- else
51- raise "timed out"
5254 end
55+ rescue IOError
56+ $stderr.puts "\nReader thread interrupted"
5357 end
5458 end
5559 end
@@ -123,8 +127,8 @@ class SocketPlayer
123127 end
124128
125129 def logout
126- stop_reader
127130 @socket.puts "LOGOUT"
131+ @socket.close
128132 end
129133
130134 end
--- a/utils/statistics.rb
+++ b/utils/statistics.rb
@@ -1,4 +1,4 @@
1-#!/usr/bin/ruby1.9.1
1+#!/usr/bin/ruby
22 # This program shows statistics of CSA kifu files like following:
33 # - Monthly #games and #players
44 # - Game results
--- a/webserver
+++ b/webserver
@@ -1,4 +1,4 @@
1-#!/usr/bin/ruby1.9.1
1+#!/usr/bin/ruby
22
33 ## Copyright (C) 2007-2012 Daigo Moriwaki <daigo at debian dot org>
44 ##