fluent-plugin-filter_where 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 72f1c27433b1df5e239750bb6cb245439f8ad860
4
- data.tar.gz: 87831d270a3c55207fae546fe20fb46d484fdb8e
3
+ metadata.gz: 9e758b04ade2bd2cff6ff9e2ed181a5e621493fc
4
+ data.tar.gz: e9c2b7cedb2c2d5cbdcb07f3536ff6bf559b7458
5
5
  SHA512:
6
- metadata.gz: ca8830bf8f2418674ca5777fab1dd4f44fc4655e63221d822093a9e9f29d9b50b98740176e8a7d0375aa98333095b055324e1660626b0172c16c4a4f3e579d0b
7
- data.tar.gz: b425a6b2fc96b0a3acd7b1dc1ebc355996862ff9d0420b3f1329484829c5218dec25a6a99087fd4b97d74fc620aae610df1b96e05ff3a58c0e8e04569c99aec6
6
+ metadata.gz: e4be09bba4b267d18a125314fa6499ce05a368c13278c390f3bd44acd587d316fcfa18c211a0dff6aa188375aeeda571ace5a8bb4d8310472656ca22bec98869
7
+ data.tar.gz: c5cba7efd6332ba53083e0732918a83919b883257973f07c8a0417f24e792fc0feafba96a2cf39ec82cb2fa64b17f26a59df2e2155be1c92e9d27fbc32468e61
@@ -1,3 +1,9 @@
1
+ ## 1.0.2 (2017-05-23)
2
+
3
+ Enhancements:
4
+
5
+ * raise ConfigError if failed to parse where
6
+
1
7
  ## 1.0.1 (2017-05-23)
2
8
 
3
9
  Fixes:
@@ -3,7 +3,7 @@ $:.push File.expand_path('../lib', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.name = "fluent-plugin-filter_where"
6
- gem.version = "1.0.1"
6
+ gem.version = "1.0.2"
7
7
  gem.authors = ["Naotoshi Seo"]
8
8
  gem.email = "sonots@gmail.com"
9
9
  gem.homepage = "https://github.com/sonots/fluent-plugin-filter_where"
@@ -14,7 +14,7 @@ module Fluent
14
14
  def configure(conf)
15
15
  super
16
16
 
17
- parser = Fluent::FilterWhere::Parser.new
17
+ parser = Fluent::FilterWhere::Parser.new(log: log)
18
18
  @scanner = parser.scan(@where)
19
19
  end
20
20
 
@@ -86,7 +86,13 @@ rule
86
86
  :STRING \\ { @string << "\\"; nil }
87
87
 
88
88
  inner
89
+ attr_reader :log
90
+ def initialize(log: nil)
91
+ @log = log || ::Logger.new(nil)
92
+ super()
93
+ end
94
+
89
95
  def on_error(error_token_id, error_value, value_stack)
90
- super
96
+ raise Fluent::ConfigError.new("filter_where: failed to parse where value_stack:#{value_stack} error_value:#{error_value.inspect}")
91
97
  end
92
98
  end
@@ -200,7 +200,12 @@ class Fluent::FilterWhere::Parser < Racc::Parser
200
200
  token
201
201
  end # def _next_token
202
202
 
203
+ attr_reader :log
204
+ def initialize(log: nil)
205
+ @log = log || ::Logger.new(nil)
206
+ super()
207
+ end
203
208
  def on_error(error_token_id, error_value, value_stack)
204
- super
209
+ raise Fluent::ConfigError.new("filter_where: failed to parse where value_stack:#{value_stack} error_value:#{error_value.inspect}")
205
210
  end
206
211
  end # class
@@ -41,14 +41,16 @@ module Fluent
41
41
  end
42
42
 
43
43
  class IdentifierLiteral < Literal
44
- attr_reader :name
45
-
46
- def initialize(name)
47
- @name = name
44
+ def initialize(text)
45
+ @text = text
48
46
  end
49
47
 
50
48
  def get(record)
51
- record[@name]
49
+ record[@text]
50
+ end
51
+
52
+ def name
53
+ @text
52
54
  end
53
55
  end
54
56
  end
@@ -53,7 +53,7 @@ class WhereParserTest < Test::Unit::TestCase
53
53
  assert_true(result.eval(record))
54
54
  result = parser.scan(%q[boolean != false])
55
55
  assert_true(result.eval(record))
56
- assert_raise(Racc::ParseError) { parser.scan(%q[boolean > false]) }
56
+ assert_raise(Fluent::ConfigError) { parser.scan(%q[boolean > false]) }
57
57
  end
58
58
 
59
59
  def test_number_op
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-filter_where
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-22 00:00:00.000000000 Z
11
+ date: 2017-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd