[Groonga-commit] groonga/groonga-query-log [master] Use Groonga::Command and Groonga::Command::Parser instead of Groonga::QueryLog::Command

Back to archive index

Haruka Yoshihara null+****@clear*****
Mon Nov 26 19:24:36 JST 2012


Haruka Yoshihara	2012-11-26 19:24:36 +0900 (Mon, 26 Nov 2012)

  New Revision: 3367f5ab0803fdbfb98b13615980f6bfd534b8b4
  https://github.com/groonga/groonga-query-log/commit/3367f5ab0803fdbfb98b13615980f6bfd534b8b4

  Log:
    Use Groonga::Command and Groonga::Command::Parser instead of Groonga::QueryLog::Command

  Modified files:
    groonga-query-log.gemspec
    lib/groonga/query-log/statistics.rb
    test/groonga-query-log-test-utils.rb

  Modified: groonga-query-log.gemspec (+2 -0)
===================================================================
--- groonga-query-log.gemspec    2012-11-23 22:52:24 +0900 (820ec95)
+++ groonga-query-log.gemspec    2012-11-26 19:24:36 +0900 (2ab5407)
@@ -51,6 +51,8 @@ Gem::Specification.new do |spec|
   spec.licenses = ["LGPLv2.1+"]
   spec.require_paths = ["lib"]
 
+  spec.add_runtime_dependency("groonga-command")
+
   spec.add_development_dependency("test-unit")
   spec.add_development_dependency("test-unit-notify")
   spec.add_development_dependency("rake")

  Modified: lib/groonga/query-log/statistics.rb (+2 -2)
===================================================================
--- lib/groonga/query-log/statistics.rb    2012-11-23 22:52:24 +0900 (51b0e3b)
+++ lib/groonga/query-log/statistics.rb    2012-11-26 19:24:36 +0900 (2f47e9b)
@@ -47,7 +47,7 @@ module Groonga
       end
 
       def command
-        @command ||= Command.parse(@raw_command)
+        @command ||= Groonga::Command::Parser.parse(@raw_command)
       end
 
       def elapsed_in_seconds
@@ -138,7 +138,7 @@ module Groonga
 
       def ensure_parse_command
         return unless select_command?
-        @select_command = SelectCommand.parse(@raw_command)
+        @select_command = Groonga::Command::Parser.parse(@raw_command)
       end
 
       def slow_operation?(elapsed)

  Modified: test/groonga-query-log-test-utils.rb (+8 -3)
===================================================================
--- test/groonga-query-log-test-utils.rb    2012-11-23 22:52:24 +0900 (868c7ae)
+++ test/groonga-query-log-test-utils.rb    2012-11-26 19:24:36 +0900 (2799471)
@@ -19,13 +19,18 @@
 require "cgi"
 require "stringio"
 
+require "groonga/command"
+
 require "groonga/query-log"
 
 module GroongaQueryLogTestUtils
   module CommandParser
     private
     def command(name, parameters)
-      Groonga::QueryLog::Command.new(name, parameters)
+      command_class = Groonga::Command.find(name)
+      command = command_class.new(name, parameters)
+      command.original_format = :command
+      command
     end
 
     def parse_http_path(command, parameters)
@@ -37,7 +42,7 @@ module GroongaQueryLogTestUtils
         path << "?"
         path << uri_parameters.join("&")
       end
-      Groonga::QueryLog::Command.parse(path)
+      Groonga::Command::Parser.parse(path)
     end
 
     def parse_command_line(command, parameters)
@@ -50,7 +55,7 @@ module GroongaQueryLogTestUtils
         end
         command_line << " --#{key} #{escaped_value}"
       end
-      Groonga::QueryLog::Command.parse(command_line)
+      Groonga::Command::Parser.parse(command_line)
     end
   end
 
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index