Navigation Menu

Skip to content

Commit

Permalink
droonga-engine: remove needless writer APIs
Browse files Browse the repository at this point in the history
Configuration should not be changed via API. It should be changed by
command line arguments.
  • Loading branch information
kou committed Jan 5, 2015
1 parent c97f2fa commit b0ec195
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions lib/droonga/command/droonga_engine.rb
Expand Up @@ -159,22 +159,11 @@ def log_level
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?
Expand Down Expand Up @@ -232,6 +221,10 @@ def default_pid_file_path
nil
end

def expand_path(path)
Pathname.new(path).expand_path
end

def config
@config ||= load_config
end
Expand Down Expand Up @@ -279,7 +272,7 @@ def add_log_options(parser)
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

Expand All @@ -296,7 +289,7 @@ def add_process_options(parser)
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

Expand Down

0 comments on commit b0ec195

Please sign in to comment.