null+****@clear*****
null+****@clear*****
2012年 6月 11日 (月) 17:07:32 JST
Haruka Yoshihara 2012-06-11 17:07:32 +0900 (Mon, 11 Jun 2012) New Revision: 0f24c8baa79d9dda1871e1c91d6228be804c4a41 Log: Extract a method to make groonga options for tests Modified files: lib/groonga/tester.rb Modified: lib/groonga/tester.rb (+22 -18) =================================================================== --- lib/groonga/tester.rb 2012-06-11 16:56:28 +0900 (fb623bf) +++ lib/groonga/tester.rb 2012-06-11 17:07:32 +0900 (eeb1823) @@ -320,24 +320,7 @@ module Groonga port = 50041 pid_file = Tempfile.new("groonga.pid") - groonga_httpd_path = File.join(@tester.base_directory, "groonga-httpd") - if****@teste***** == groonga_httpd_path - db_path = context.db_path - config_file = create_config_file(host, port, db_path, pid_file) - groonga_options = [ - "-c", config_file.path, - ] - else - groonga_options = [ - "--pid-path", pid_file.path, - "--bind-address", host, - "--port", port.to_s, - "--protocol", @tester.protocol.to_s, - "-d", - "-n", context.db_path, - ] - end - + groonga_options = build_groonga_options(host, port, pid_file, context) command_line = [ @tester.groonga, ] @@ -363,6 +346,27 @@ module Groonga end end + def build_groonga_options(host, port, pid_file, context) + groonga_httpd_path = File.join(@tester.base_directory, "groonga-httpd") + if****@teste***** == groonga_httpd_path + db_path = context.db_path + config_file = create_config_file(host, port, db_path, pid_file) + groonga_options = [ + "-c", config_file.path, + ] + else + groonga_options = [ + "--pid-path", pid_file.path, + "--bind-address", host, + "--port", port.to_s, + "--protocol", @tester.protocol.to_s, + "-d", + "-n", context.db_path, + ] + end + groonga_options + end + def create_config_file(host, port, db_path, pid_file) config_file = Tempfile.new("test-httpd.conf") config_file.puts <<EOF