YUKI Hiroshi
null+****@clear*****
Thu May 8 16:48:38 JST 2014
YUKI Hiroshi 2014-05-08 16:48:38 +0900 (Thu, 08 May 2014) New Revision: 6d68b3c57bc1519a33eada4c035585ed28f6fcc7 https://github.com/droonga/droonga-engine/commit/6d68b3c57bc1519a33eada4c035585ed28f6fcc7 Message: Receive "--live-nodes-file" option by droonga-engine command Modified files: lib/droonga/engine/command/droonga_engine.rb Modified: lib/droonga/engine/command/droonga_engine.rb (+14 -2) =================================================================== --- lib/droonga/engine/command/droonga_engine.rb 2014-05-08 16:37:15 +0900 (0c629f1) +++ lib/droonga/engine/command/droonga_engine.rb 2014-05-08 16:48:38 +0900 (be558f7) @@ -17,6 +17,7 @@ require "optparse" require "socket" require "ipaddr" require "fileutils" +require "pathname" require "droonga/engine" require "droonga/event_loop" @@ -35,11 +36,12 @@ module Droonga DEFAULT_HOST = Socket.gethostname DEFAULT_PORT = 10031 - attr_reader :host, :port, :tag, :log_file, :pid_file + attr_reader :host, :port, :tag, :live_nodes_file, :log_file, :pid_file def initialize @host = DEFAULT_HOST @port = DEFAULT_PORT @tag = "droonga" + @live_nodes_file = nil @log_file = nil @daemon = false @pid_file = nil @@ -63,12 +65,18 @@ module Droonga end def to_command_line - [ + command_line_options = [ "--host", @host, "--port", @port.to_s, "--tag", @tag, "--log-level", log_level, ] + if live_nodes_file + command_line_options += [ + "--live-nodes-file", live_nodes_file.to_s, + ] + end + command_line_options end def add_command_line_options(parser) @@ -96,6 +104,10 @@ module Droonga "(#{@tag})") do |tag| @tag = tag end + parser.on("--live-nodes-file=FILE", + "Path to the list file of live nodes") do |file| + @live_nodes_file = Pathname(file) + end end def add_log_options(parser) -------------- next part -------------- HTML����������������������������... Download