Kouhei Sutou
null+****@clear*****
Mon Feb 17 17:44:03 JST 2014
Kouhei Sutou 2014-02-17 17:44:03 +0900 (Mon, 17 Feb 2014) New Revision: abec5e2316a0ff56df9a00ee022daf716d27eb54 https://github.com/droonga/fluent-plugin-droonga/commit/abec5e2316a0ff56df9a00ee022daf716d27eb54 Message: MessageMatcher: remove :include? and :exist? It breaks backward incompatibility. But we are not released 1.0.0 yet. Modified files: lib/droonga/message_matcher.rb test/unit/test_message_matcher.rb Modified: lib/droonga/message_matcher.rb (+2 -3) =================================================================== --- lib/droonga/message_matcher.rb 2014-02-17 17:34:56 +0900 (cd266f3) +++ lib/droonga/message_matcher.rb 2014-02-17 17:44:03 +0900 (e165c2f) @@ -22,7 +22,6 @@ module Droonga # * PATTERN = [PATTERN, LOGICAL_OPERATOR, PATTERN] # * TARGET_PATH = "COMPONENT(.COMPONENT)*" # * OPERATOR = :equal, :in, :include, :exist, :start_with - # (:include? and :exist? are deprecated. Use no "?" version.) # (More operators may be added in the future. # For example, :end_with and so on.) # * ARGUMENTS = OBJECT_DEFINED_IN_JSON* @@ -87,12 +86,12 @@ module Droonga arguments.any? do |argument| argument.include?(target) end - when :include, :include? + when :include return false unless target.respond_to?(:include?) arguments.any? do |argument| target.include?(argument) end - when :exist, :exist? + when :exist target != NONEXISTENT_PATH when :start_with return false unless target.respond_to?(:start_with?) Modified: test/unit/test_message_matcher.rb (+0 -16) =================================================================== --- test/unit/test_message_matcher.rb 2014-02-17 17:34:56 +0900 (65858e3) +++ test/unit/test_message_matcher.rb 2014-02-17 17:44:03 +0900 (fe66f38) @@ -114,13 +114,6 @@ class MessageMatcherTest < Test::Unit::TestCase "originalTypes" => 29, })) end - - def test_backward_compatibility - assert_true(match?(["originalTypes", :include?, "select"], - { - "originalTypes" => ["search", "select"], - })) - end end class ExistTest < self @@ -139,15 +132,6 @@ class MessageMatcherTest < Test::Unit::TestCase "body" => nil, })) end - - def test_backward_compatibility - assert_true(match?(["body.result", :exist?], - { - "body" => { - "result" => nil, - }, - })) - end end class StartWithTest < self -------------- next part -------------- HTML����������������������������...Download