HorimotoYasuhiro
null+****@clear*****
Wed Apr 12 14:57:23 JST 2017
HorimotoYasuhiro 2017-04-12 14:57:23 +0900 (Wed, 12 Apr 2017) New Revision: 7872796fc9cbdcac5f9f54c0a02868227212f406 https://github.com/groonga/groonga-query-log/commit/7872796fc9cbdcac5f9f54c0a02868227212f406 Merged 47fec05: Merge pull request #5 from komainu8/feature/add_new_option Message: Fix description of new options. Delete feature that limits groonga's option. Modified files: lib/groonga/query-log/command/run-regression-test.rb Modified: lib/groonga/query-log/command/run-regression-test.rb (+16 -42) =================================================================== --- lib/groonga/query-log/command/run-regression-test.rb 2017-04-11 13:57:35 +0900 (922a7da) +++ lib/groonga/query-log/command/run-regression-test.rb 2017-04-12 14:57:23 +0900 (61d6ad3) @@ -97,11 +97,10 @@ module Groonga @old_groonga = groonga end - parser.separator("") - parser.separator("Old Groonga Option:") - parser.on("--old-groonga-option=GROONGA_OPTION", - "Old groonga option", - "(#{@old_groonga_options})") do |groonga_option| + parser.on("--old-groonga-option=OPTION", + "Add an additional old groonga option", + "You can specify this option multiple times to specify multiple groonga options", + "(no options)") do |groonga_option| @old_groonga_options << groonga_option end @@ -113,11 +112,10 @@ module Groonga @new_groonga = groonga end - parser.separator("") - parser.separator("New Groonga Option:") - parser.on("--new-groonga-option=GROONGA_OPTION", - "New groonga option", - "(#{@new_groonga_options})") do |groonga_option| + parser.on("--new-groonga-option=OPTION", + "Add an additional new groonga option", + "You can specify this option multiple times to specify multiple groonga options", + "(no options)") do |groonga_option| @new_groonga_options << groonga_option end @@ -177,37 +175,16 @@ module Groonga directory_options.merge(options) end - def groonga_options(options) - groonga_options = Hash[*options] - - filter = %w[ - --server-id - --document-root - --cache-limit - --max-threads - --default-request-timeout - --memcached-column - --cache-base-path - --log-level - --log-rotate-threshold - --query-log-rotate-threshold - --config-path - --default-command-version - --default-match-escalation-threshold - ] - groonga_options.keep_if{|k,v| filter.include?(k)} - end - def old_groonga_server GroongaServer.new(@old_groonga, - groonga_options(@old_groonga_options), + @old_groonga_options, @old_database, server_options) end def new_groonga_server GroongaServer.new(@new_groonga, - groonga_options(@new_groonga_options), + @new_groonga_options, @new_database, server_options) end @@ -228,15 +205,12 @@ module Groonga def run return unless @options[:run_queries] - arguments = [ - "--bind-address", @host, - "--port", @port.to_s, - "--protocol", "http", - "--log-path", log_path.to_s, - ] - @groonga_options.each{|name, value| - arguments.concat([name, value]) - } + arguments = @groonga_options.dup + + arguments.concat(["--bind-address", @host]) + arguments.concat(["--port", @port.to_s]) + arguments.concat(["--protocol", "http"]) + arguments.concat(["--log-path", log_path.to_s]) if @options[:output_query_log] arguments.concat(["--query-log-path", query_log_path.to_s]) end -------------- next part -------------- HTML����������������������������... 下载