[Groonga-commit] ranguba/groonga-client at 3bc8b10 [master] Fix a bug that scorer required 2 arguments

Back to archive index

Kouhei Sutou null+****@clear*****
Wed May 31 15:21:11 JST 2017


Kouhei Sutou	2017-05-31 15:21:11 +0900 (Wed, 31 May 2017)

  New Revision: 3bc8b1040d49954c8599d4598db31b21a603f849
  https://github.com/ranguba/groonga-client/commit/3bc8b1040d49954c8599d4598db31b21a603f849

  Message:
    Fix a bug that scorer required 2 arguments

  Modified files:
    lib/groonga/client/request/select.rb
    test/request/select/test-scorer.rb

  Modified: lib/groonga/client/request/select.rb (+1 -1)
===================================================================
--- lib/groonga/client/request/select.rb    2017-05-31 15:17:31 +0900 (611f0b0)
+++ lib/groonga/client/request/select.rb    2017-05-31 15:21:11 +0900 (8cd3ffc)
@@ -143,7 +143,7 @@ module Groonga
           end
         end
 
-        def scorer(expression_or_column_name, values_or_value)
+        def scorer(expression_or_column_name, values_or_value=nil)
           case expression_or_column_name
           when Symbol
             expression = "_score = %{column}"

  Modified: test/request/select/test-scorer.rb (+4 -3)
===================================================================
--- test/request/select/test-scorer.rb    2017-05-31 15:17:31 +0900 (318e0ba)
+++ test/request/select/test-scorer.rb    2017-05-31 15:21:11 +0900 (6454ceb)
@@ -1,4 +1,5 @@
-# Copyright (C) 2016-2017  Yasuhiro Horimoto <horimoto �� clear-code.com>
+# Copyright (C) 2017  Yasuhiro Horimoto <horimoto �� clear-code.com>
+# Copyright (C) 2017  Kouhei Sutou <kou �� clear-code.com>
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -19,8 +20,8 @@ class TestRequestSelectScorer < Test::Unit::TestCase
     @request = Groonga::Client::Request::Select.new("posts")
   end
 
-  def scorer(expression, values=nil)
-    @request.scorer(expression, values).to_parameters
+  def scorer(*args)
+    @request.scorer(*args).to_parameters
   end
 
   sub_test_case("expression") do
-------------- next part --------------
HTML����������������������������...
Download 



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