Kouhei Sutou
null+****@clear*****
Mon Jan 5 13:33:00 JST 2015
Kouhei Sutou 2015-01-05 13:33:00 +0900 (Mon, 05 Jan 2015) New Revision: b0ec195d388f1197975c51ba9ecd713b5ca83e18 https://github.com/droonga/droonga-engine/commit/b0ec195d388f1197975c51ba9ecd713b5ca83e18 Message: droonga-engine: remove needless writer APIs Configuration should not be changed via API. It should be changed by command line arguments. Modified files: lib/droonga/command/droonga_engine.rb Modified: lib/droonga/command/droonga_engine.rb (+8 -15) =================================================================== --- lib/droonga/command/droonga_engine.rb 2015-01-05 13:22:43 +0900 (6e0e2dd) +++ lib/droonga/command/droonga_engine.rb 2015-01-05 13:33:00 +0900 (81bd307) @@ -159,22 +159,11 @@ module Droonga end def log_file_path - path = @log_file_path || config["log_file"] || default_log_file_path - Pathname.new(path).expand_path - end - - def log_file_path=(path) - @log_file_path = Pathname.new(path).expand_path + @log_file_path || config["log_file"] || default_log_file_path end def pid_file_path - path = @pid_file_path || config["pid_file"] || default_pid_file_path - return nil if path.nil? - Pathname.new(path.to_s).expand_path - end - - def pid_file_path=(path) - @pid_file_path = Pathname.new(path).expand_path + @pid_file_path || config["pid_file"] || default_pid_file_path end def daemon? @@ -232,6 +221,10 @@ module Droonga nil end + def expand_path(path) + Pathname.new(path).expand_path + end + def config @config ||= load_config end @@ -279,7 +272,7 @@ module Droonga parser.on("--log-file=FILE", "Output logs to FILE", "(#{default_log_file_path})") do |path| - self.log_file_path = path + @log_file_path = expand_path(path) end end @@ -296,7 +289,7 @@ module Droonga end parser.on("--pid-file=PATH", "Put PID to PATH") do |path| - self.pid_file_path = path + @pid_file_path = expand_path(path) end end -------------- next part -------------- HTML����������������������������...下载