X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=csa-file-filter;h=a9a3f8fe9b7f93cb2addefa855779e0802883f56;hb=bda0cbd86a4e0e7c18fcfaf3a783c584cd7a86ad;hp=297edc0089ef37ec6e6dd55044da65a8f359348b;hpb=f632cd7d9aff91966b5e2e93d1a1ff576cb90b0d;p=shogi-server%2Fshogi-server.git diff --git a/csa-file-filter b/csa-file-filter index 297edc0..a9a3f8f 100755 --- a/csa-file-filter +++ b/csa-file-filter @@ -5,7 +5,7 @@ # Homepage:: http://sourceforge.jp/projects/shogi-server/ # #-- -# Copyright (C) 2008 Daigo Moriwaki +# Copyright (C) 2008-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 @@ -50,9 +50,9 @@ # # Sample Command lines that isntall prerequires will work on Debian. # -# * Ruby 1.8.7 including RDoc +# * Ruby 2.0.0 or later including RDoc # -# $ sudo aptitude install ruby ruby1.8 +# $ sudo aptitude install ruby ruby # # == Example # @@ -76,10 +76,8 @@ def filter(filename) return unless /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.csa$/ =~ filename file_date = Date.new($1.to_i, $2.to_i, $3.to_i) - now = Time.now - now_date = Date.new(now.year, now.month, now.day) - return if now_date - file_date > $options["within"] + return if $now_date - file_date > $options["within"] end puts filename @@ -145,6 +143,8 @@ def main end if __FILE__ == $0 + now = Time.now + $now_date = Date.new(now.year, now.month, now.day) main end