Kouhei Sutou
null+****@clear*****
Sun Mar 6 00:10:38 JST 2016
Kouhei Sutou 2016-03-06 00:10:38 +0900 (Sun, 06 Mar 2016) New Revision: 1fa22ae7f48e8fcb72bf61488806a34283ebf5c0 https://github.com/ranguba/rroonga/commit/1fa22ae7f48e8fcb72bf61488806a34283ebf5c0 Message: Remove code for Ruby 1.9 Removed files: lib/groonga/expression-builder-19.rb Modified files: lib/groonga/expression-builder.rb test/groonga-test-utils.rb test/test-expression-builder.rb test/test-table-select.rb Deleted: lib/groonga/expression-builder-19.rb (+0 -40) 100644 =================================================================== --- lib/groonga/expression-builder-19.rb 2016-03-06 00:04:16 +0900 (a5cdb98) +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2011 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 -# License version 2.1 as published by the Free Software Foundation. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -module Groonga - module ExpressionBuildable - class ColumnValueExpressionBuilder - def !=(other) - NotEqualExpressionBuilder.new(self, normalize(other)) - end - end - - # @private - class NotEqualExpressionBuilder < BinaryExpressionBuilder - def initialize(column_value_builder, value) - super(Groonga::Operation::NOT_EQUAL, column_value_builder, value) - end - end - end - - # @private - class ColumnExpressionBuilder - def !=(other) - column_value_builder != other - end - end -end Modified: lib/groonga/expression-builder.rb (+16 -5) =================================================================== --- lib/groonga/expression-builder.rb 2016-03-06 00:04:16 +0900 (1a19d15) +++ lib/groonga/expression-builder.rb 2016-03-06 00:10:38 +0900 (b99001f) @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # Copyright (C) 2015 Masafumi Yokoyama <yokoyama �� clear-code.com> -# Copyright (C) 2009-2015 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 @@ -183,6 +183,10 @@ module Groonga EqualExpressionBuilder.new(self, normalize(other)) end + def !=(other) + NotEqualExpressionBuilder.new(self, normalize(other)) + end + def =~(other) if other.nil? full_column_name = "#{@table.name}.#{@column_name}" @@ -350,6 +354,13 @@ module Groonga end # @private + class NotEqualExpressionBuilder < BinaryExpressionBuilder + def initialize(column_value_builder, value) + super(Groonga::Operation::NOT_EQUAL, column_value_builder, value) + end + end + + # @private class MatchExpressionBuilder < BinaryExpressionBuilder def initialize(column_value_builder, value) super(Groonga::Operation::MATCH, column_value_builder, value) @@ -613,6 +624,10 @@ module Groonga column_expression_builder == other end + def !=(other) + column_expression_builder != other + end + def =~(other) column_expression_builder =~ other end @@ -684,7 +699,3 @@ module Groonga end end end - -if RUBY_VERSION >= "1.9" - require "groonga/expression-builder-19" -end Modified: test/groonga-test-utils.rb (+0 -8) =================================================================== --- test/groonga-test-utils.rb 2016-03-06 00:04:16 +0900 (067295c) +++ test/groonga-test-utils.rb 2016-03-06 00:10:38 +0900 (2bd9b36) @@ -158,14 +158,6 @@ module GroongaTestUtils actual.expression.inspect) end - def ruby19? - RUBY_VERSION >= "1.9" - end - - def only_ruby19 - omit("Ruby 1.9 is needed.") unless ruby19? - end - def linux? /linux/ =~ RUBY_PLATFORM end Modified: test/test-expression-builder.rb (+1 -3) =================================================================== --- test/test-expression-builder.rb 2016-03-06 00:04:16 +0900 (51a18ec) +++ test/test-expression-builder.rb 2016-03-06 00:10:38 +0900 (17f7e00) @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # Copyright (C) 2014-2015 Masafumi Yokoyama <yokoyama �� clear-code.com> -# Copyright (C) 2009-2015 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 @@ -79,8 +79,6 @@ class ExpressionBuilderTest < Test::Unit::TestCase end class NotEqualTest < self - setup :only_ruby19 - def test_without_index result =****@users***** do |record| record["name"] != "mori daijiro" Modified: test/test-table-select.rb (+0 -1) =================================================================== --- test/test-table-select.rb 2016-03-06 00:04:16 +0900 (98f8a3b) +++ test/test-table-select.rb 2016-03-06 00:10:38 +0900 (6da210d) @@ -153,7 +153,6 @@ class TableSelectTest < Test::Unit::TestCase end def test_not_equal_block - only_ruby19 @result =****@comme***** do |record| record.user != "darashi" end -------------- next part -------------- HTML����������������������������...Télécharger