OSDN Git Service

Follow an API change in the upstream: LogDevice
authorDaigo Moriwaki <daigo@debian.org>
Mon, 12 Jan 2015 14:13:13 +0000 (23:13 +0900)
committerDaigo Moriwaki <daigo@debian.org>
Mon, 12 Jan 2015 14:16:11 +0000 (23:16 +0900)
changelog
shogi_server.rb

index 25da4bb..fd6bd2e 100644 (file)
--- a/changelog
+++ b/changelog
@@ -1,3 +1,9 @@
+2015-01-12  Daigo Moriwaki <daigo at debian dot org>
+
+       * [shogi-server]
+         - shogi_server.rb: Follow an API change in a upstream class:
+           LogDevice.previous_period_end
+
 2014-10-12  Daigo Moriwaki <daigo at debian dot org>
 
        * [shogi_server]
index dd227ae..f3d58d9 100644 (file)
@@ -84,7 +84,11 @@ class Logger < ::Logger
       end
 
       def age_file_name(time)
-        postfix = previous_period_end(time).strftime("%Y%m%d") # YYYYMMDD
+        if RUBY_VERSION >= "2.2.0"
+          postfix = previous_period_end(time, @shift_age).strftime("%Y%m%d")   # YYYYMMDD
+        else
+          postfix = previous_period_end(time).strftime("%Y%m%d")       # YYYYMMDD
+        end
         age_file = File.join(
                      File.dirname(@filename),
                      postfix[0..3], # YYYY