fluent-plugin-uri_decoder 0.1.0 → 0.1.1

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: 7b04f3cbd3a4c76240f197ee2691770b974a7788
4
- data.tar.gz: 3fc00cb9d59e3cc592f40968e761ed42d3cf9385
3
+ metadata.gz: 4d69b16a2bd1b9de5921ce8949c1c1361360c963
4
+ data.tar.gz: 5b59c556a38c780169f9b801781a032e16151e08
5
5
  SHA512:
6
- metadata.gz: bfa71f002ee3fc7a6a09a69cb981814fd56eb627a8dcd63cf9592704782fc65f24f789bb990b5d919325e6584ae6704704637176203a5138c37fabfe787e371a
7
- data.tar.gz: 66383a9770c476f3cecef5259c7f121dcc5b075f14e93d9fe7aa8e1813c9b042f0d96ecaf4f31be511a2ecef18ad6bd028269188a7d03afcad16e8ab01e1cc46
6
+ metadata.gz: e58d285ce75dff44cc190aff9c58fa78892e3b26d7cc385c9a975d9bc4315a5486645b8078325bbf0fe992cde7875ad9a9405b53b50efd31e91dbb2bba4a8780
7
+ data.tar.gz: 47d0ab78e6ebc9604bfe50e4fafb04968d477d15a2ff35e34bd983896cc6900134b271edc64cb4a0e1ed383bd1009a9ce9acf66901298083e61a61f8bb85c52d
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Fluent::Plugin::URIDecoder
1
+ # fluent-plugin-uri_decoder
2
2
 
3
3
  Fluent plugin to decode uri encoded value.
4
4
 
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "fluent-plugin-uri_decoder"
7
- spec.version = "0.1.0"
7
+ spec.version = "0.1.1"
8
8
  spec.authors = ["Yasuharu Ozaki"]
9
9
  spec.email = ["yasuharu.ozaki@gmail.com"]
10
10
  spec.description = %q{Fluent plugin to decode uri encoded value. See more https://github.com/YasuOza/fluent-plugin-uri_decoder}
@@ -53,7 +53,9 @@ class Fluent::URIDecoder < Fluent::Output
53
53
  def emit(tag, es, chain)
54
54
  tag = tag_mangle(tag)
55
55
 
56
- if @key_names
56
+ # After first emit, @key_names will be array of given key names.
57
+ # Escape [].split, ensure @key_names to be an instance of String.
58
+ if @key_names.kind_of?(String)
57
59
  @key_names = @key_names.split(/,\s*/)
58
60
  end
59
61
  @key_names << @key_name if @key_name
@@ -1,5 +1,5 @@
1
1
  require 'test_helper'
2
- require 'fluent/plugin/uri_decoder'
2
+ require 'fluent/plugin/out_uri_decode'
3
3
 
4
4
  class Fluent::URIDecorderTest < MiniTest::Unit::TestCase
5
5
  CONFIG0 = %[
@@ -89,4 +89,25 @@ class Fluent::URIDecorderTest < MiniTest::Unit::TestCase
89
89
  assert_equal '#hash', emits[0][2]['encoded']
90
90
  assert_equal '#another_hash', emits[0][2]['another_encoded']
91
91
  end
92
+
93
+ def test_multiple_emit
94
+ d = create_driver(CONFIG2, 'encoded.message')
95
+ time = Time.now.to_i
96
+ d.run do
97
+ d.emit({'encoded' => '%23hash', 'another_encoded' => '%23another_hash'}, time)
98
+ end
99
+
100
+ emits = d.emits
101
+ emits << d.emits.flatten
102
+ assert_equal 2, emits.size
103
+ assert_equal 'decoded.message', emits[0][0]
104
+ assert_equal time, emits[0][1]
105
+ assert_equal '#hash', emits[0][2]['encoded']
106
+ assert_equal '#another_hash', emits[0][2]['another_encoded']
107
+
108
+ assert_equal 'decoded.message', emits[1][0]
109
+ assert_equal time, emits[1][1]
110
+ assert_equal '#hash', emits[1][2]['encoded']
111
+ assert_equal '#another_hash', emits[1][2]['another_encoded']
112
+ end
92
113
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-uri_decoder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yasuharu Ozaki
@@ -65,7 +65,7 @@ files:
65
65
  - README.md
66
66
  - Rakefile
67
67
  - fluent-plugin-uri_decoder.gemspec
68
- - lib/fluent/plugin/uri_decoder.rb
68
+ - lib/fluent/plugin/out_uri_decode.rb
69
69
  - test/plugin/test_out_uri_decoder.rb
70
70
  - test/test_helper.rb
71
71
  homepage: https://github.com/YasuOza/fluent-plugin-uri_decoder