[Groonga-commit] droonga/droonga-engine at 70f5f95 [master] droonga-engine: use Pathname

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Jan 5 13:10:21 JST 2015


Kouhei Sutou	2015-01-05 13:10:21 +0900 (Mon, 05 Jan 2015)

  New Revision: 70f5f95e5a471ec408c7e3db72f33bf4d5c70cce
  https://github.com/droonga/droonga-engine/commit/70f5f95e5a471ec408c7e3db72f33bf4d5c70cce

  Message:
    droonga-engine: use Pathname

  Modified files:
    lib/droonga/command/droonga_engine.rb

  Modified: lib/droonga/command/droonga_engine.rb (+10 -10)
===================================================================
--- lib/droonga/command/droonga_engine.rb    2015-01-05 13:05:50 +0900 (40b6214)
+++ lib/droonga/command/droonga_engine.rb    2015-01-05 13:10:21 +0900 (3780170)
@@ -86,8 +86,8 @@ module Droonga
       end
 
       def open_log_file
-        if****@confi*****_file
-          File.open(@configuration.log_file, "a") do |file|
+        if****@confi*****_file_path
+          @configuration.log_file_path.open("a") do |file|
             $stdout.reopen(file)
             $stderr.reopen(file)
             yield
@@ -156,13 +156,13 @@ module Droonga
           ENV["DROONGA_LOG_LEVEL"] = level
         end
 
-        def log_file
-          file = @log_file || config["log_file"] || default_log_file
-          File.expand_path(file)
+        def log_file_path
+          path = @log_file_path || config["log_file"] || default_log_file_path
+          Pathname.new(path).expand_path
         end
 
-        def log_file=(file)
-          @log_file = File.expand_path(file)
+        def log_file_path=(path)
+          @log_file_path = Pathname.new(path).expand_path
         end
 
         def pid_file_path
@@ -222,7 +222,7 @@ module Droonga
           ENV["DROONGA_LOG_LEVEL"] || Logger::Level.default
         end
 
-        def default_log_file
+        def default_log_file_path
           Path.default_log_file
         end
 
@@ -275,8 +275,8 @@ module Droonga
             self.log_level = level
           end
           parser.on("--log-file=FILE",
-                    "Output logs to FILE") do |file|
-            self.log_file = file
+                    "Output logs to FILE") do |path|
+            self.log_file_path = path
           end
         end
 
-------------- next part --------------
HTML����������������������������...
下載 



More information about the Groonga-commit mailing list
Back to archive index