fluent-plugin-gcloud-pubsub-custom 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a55a4279110490b7ac03da92af18e269d92d5d75af86d294a130acd4fb440364
4
- data.tar.gz: cfa6ba338f70ae9826fc71e3733dfb6c42175f55ae7015db38fc1703c643ed33
3
+ metadata.gz: 76c67cd4a1690b17057f8961cc06136afe5ae3d56adfc6dc37c49190c845368b
4
+ data.tar.gz: f0cf742945f94fcfc05e2364ad4881dce89c1bc6dfc723143236390ae8a90a53
5
5
  SHA512:
6
- metadata.gz: 00aedffe49e51e556d3b8ef86965b67614aab97d7bb06ef1032d8b826ff8d33ca85383d822430ff8c30f6638372bd2a7f2544d86d6745b9b4f89395af384e226
7
- data.tar.gz: 0b4c66aa2418626728eebb048a4e57f1f49915d609bbf028c7979ca0ce79168e36a3d413d79301faf5ce4fb998162ae75e508b784f6764a0d08aad76a6af6d45
6
+ metadata.gz: 671c29ebbef19b4155100aa6bedfdb686ee2bb79310e8c5ccb553806fde095cbd6c3ea5ff225eecfc29f6607ffc270205490873e564d3b2dfc713ce190cb26c0
7
+ data.tar.gz: 158b3b2aa6f5f59e5fe0d8e8cfe6e1dbb2cf1e49541a6d0b8d9e21e15f0d4f8a536ea120bc76ef255a8b66c250ca1c92351bfa087c82eac00851a2f2b033307d
data/CHANGELOG.md CHANGED
@@ -1,8 +1,14 @@
1
1
  ## ChangeLog
2
2
 
3
+ ### Release 1.2.0 - 2018/04/24
4
+
5
+ - Output plugin
6
+ - Support inject section
7
+
3
8
  ### Release 1.1.0 - 2018/03/30
4
9
 
5
- - The placeholder is now available in topic param
10
+ - Output plugin
11
+ - The placeholder is now available in topic param
6
12
 
7
13
  ### Release 1.0.3 - 2018/03/29
8
14
 
@@ -7,7 +7,7 @@ Gem::Specification.new do |gem|
7
7
  gem.license = "MIT"
8
8
  gem.homepage = "https://github.com/mia-0032/fluent-plugin-gcloud-pubsub-custom"
9
9
  gem.summary = gem.description
10
- gem.version = "1.1.0"
10
+ gem.version = "1.2.0"
11
11
  gem.authors = ["Yoshihiro MIYAI"]
12
12
  gem.email = "msparrow17@gmail.com"
13
13
  gem.has_rdoc = false
@@ -1,9 +1,11 @@
1
1
  require 'fluent/plugin/output'
2
-
3
2
  require 'fluent/plugin/gcloud_pubsub/client'
3
+ require 'fluent/plugin_helper/inject'
4
4
 
5
5
  module Fluent::Plugin
6
6
  class GcloudPubSubOutput < Output
7
+ include Fluent::PluginHelper::Inject
8
+
7
9
  Fluent::Plugin.register_output('gcloud_pubsub', self)
8
10
 
9
11
  helpers :compat_parameters, :formatter
@@ -47,6 +49,7 @@ module Fluent::Plugin
47
49
  end
48
50
 
49
51
  def format(tag, time, record)
52
+ record = inject_values_to_record(tag, time, record)
50
53
  @formatter.format(tag, time, record).to_msgpack
51
54
  end
52
55
 
@@ -206,5 +206,21 @@ class GcloudPubSubOutputTest < Test::Unit::TestCase
206
206
  end
207
207
  end
208
208
  end
209
+
210
+ test 'inject section' do
211
+ d = create_driver(%[
212
+ project project-test
213
+ topic topic-test
214
+ key key-test
215
+ <inject>
216
+ tag_key tag
217
+ </inject>
218
+ ])
219
+ @publisher.publish.once
220
+ d.run(default_tag: 'test') do
221
+ d.feed({"foo" => "bar"})
222
+ end
223
+ assert_equal({"tag" => 'test', "foo" => "bar"}, JSON.parse(MessagePack.unpack(d.formatted.first)))
224
+ end
209
225
  end
210
226
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-gcloud-pubsub-custom
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoshihiro MIYAI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-30 00:00:00.000000000 Z
11
+ date: 2018-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd