[Groonga-commit] ranguba/rroonga at 95a12fb [master] Revert "Add backward compatibility code for Groonga 7.0.2"

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Apr 25 15:00:59 JST 2017


Kouhei Sutou	2017-04-25 15:00:59 +0900 (Tue, 25 Apr 2017)

  New Revision: 95a12fb82c1fd099d74eeda9e563b85cd54978f6
  https://github.com/ranguba/rroonga/commit/95a12fb82c1fd099d74eeda9e563b85cd54978f6

  Message:
    Revert "Add backward compatibility code for Groonga 7.0.2"
    
    This reverts commit e8aedd0d0139472d125167657d8fd87e7e8bc4e0.
    
    Because Groonga 7.0.2 reverted OP_CALL nargs incompatibility.

  Modified files:
    lib/groonga/expression-builder.rb

  Modified: lib/groonga/expression-builder.rb (+3 -22)
===================================================================
--- lib/groonga/expression-builder.rb    2017-04-19 11:30:12 +0900 (d7339ad)
+++ lib/groonga/expression-builder.rb    2017-04-25 15:00:59 +0900 (c4732d1)
@@ -1,5 +1,5 @@
 # Copyright (C) 2015  Masafumi Yokoyama <yokoyama �� clear-code.com>
-# Copyright (C) 2009-2017  Kouhei Sutou <kou �� clear-code.com>
+# Copyright (C) 2009-2016  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
@@ -16,24 +16,7 @@
 
 module Groonga
   # @private
-  module CallOperationAppendable
-    private
-    def append_call_operation(expression, n_arguments)
-      # TODO: Remove me when we require Groonga 7.0.2 or later.
-      if (VERSION[0, 3] <=> [7, 0, 2]) > 0 or
-          (VERSION[0, 3] == [7, 0, 1] and
-           (VERSION[3] || "0").split("-")[0].to_i >= 105)
-        expression.append_operation(Operation::CALL, 1 + n_arguments)
-      else
-        expression.append_operation(Operation::CALL, n_arguments)
-      end
-    end
-  end
-
-  # @private
   module ExpressionBuildable
-    include CallOperationAppendable
-
     attr_reader :table
     attr_accessor :query
     attr_accessor :syntax
@@ -98,7 +81,7 @@ module Groonga
 
       if builders.empty?
         expression.append_object(@table.context["all_records"])
-        append_call_operation(expression, 0)
+        expression.append_operation(Operation::CALL, 0)
       else
         combined_builder = builders.inject do |previous, builder|
           previous & builder
@@ -505,8 +488,6 @@ module Groonga
 
     # @private
     class CallExpressionBuilder < ExpressionBuilder
-      include CallOperationAppendable
-
       def initialize(function, *arguments)
         super()
         @function = function
@@ -525,7 +506,7 @@ module Groonga
             argument.build(expression, variable)
           end
         end
-        append_call_operation(expression, @arguments.size)
+        expression.append_operation(Operation::CALL, @arguments.size)
       end
     end
   end
-------------- next part --------------
HTML����������������������������...
Download 



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