fluent-plugin-chatwork 2.0.1 → 2.0.2

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
  SHA1:
3
- metadata.gz: 5f0295235d5fb399779403c89791ef9091570c7a
4
- data.tar.gz: 7783524278a984ce7c5df3128e03738a31f0c172
3
+ metadata.gz: 72b9074700991322749b868e02b33720856f4970
4
+ data.tar.gz: 13807e97370d73b831464d21be1d2a20cd44896f
5
5
  SHA512:
6
- metadata.gz: f1ee8a80bb699fda354c5831f2c7f533f4571cedeb8ab2332222d63a7871ebdeb38163191b10b8c1e6a0b61c7aa05628ad61e037e906d565124ecfc63331b060
7
- data.tar.gz: db97642715bcea3b3f52a75a2b4c75642e3f6fcebbfe93d1a3311eab327a71bc2ea6c55bb2ace87126524b73dfecf0be7802cc481a2b7000eafa3880c586d690
6
+ metadata.gz: f8e6f5100431c60c8edcf25026c644839da746828bce1868e5260901a55d5a643c43d2bea97ec8aa02ee416a2b55bc5ce51f318902e777e2fd67bf26662a0e2c
7
+ data.tar.gz: c569290c67eb66bbb8c0a2c9b61222d7434405baa18bb61a4864c71721301f2a726dcccdea2bd16aa921c9cebe8afe66082c99cf9d223cf3d50d72d1f6c7b93d
@@ -1,6 +1,12 @@
1
1
  # Changelog
2
2
  ## master
3
- [full changelog](https://github.com/sue445/fluent-plugin-chatwork/compare/v2.0.1...master)
3
+ [full changelog](https://github.com/sue445/fluent-plugin-chatwork/compare/v2.0.2...master)
4
+
5
+ ## 2.0.2
6
+ [full changelog](https://github.com/sue445/fluent-plugin-chatwork/compare/v2.0.1...v2.0.2)
7
+
8
+ * Verify tag existence in chunk keys
9
+ * https://github.com/sue445/fluent-plugin-chatwork/pull/16
4
10
 
5
11
  ## 2.0.1
6
12
  [full changelog](https://github.com/sue445/fluent-plugin-chatwork/compare/v2.0.0...v2.0.1)
data/README.md CHANGED
@@ -9,6 +9,13 @@ fluentd output plugin for post to [ChatWork](http://www.chatwork.com/)
9
9
  [![Code Climate](https://codeclimate.com/github/sue445/fluent-plugin-chatwork.png)](https://codeclimate.com/github/sue445/fluent-plugin-chatwork)
10
10
  [![Inline docs](http://inch-ci.org/github/sue445/fluent-plugin-chatwork.svg?branch=master)](http://inch-ci.org/github/sue445/fluent-plugin-chatwork)
11
11
 
12
+ ## Requirements
13
+
14
+ | fluent-plugin-chatwork | fluentd | ruby |
15
+ |------------------------|---------|------|
16
+ | >= 2.0.0 | >= v0.14.0 | >= 2.1 |
17
+ | < 2.0.0 | >= v0.12.0 | >= 1.9 |
18
+
12
19
  ## Installation
13
20
 
14
21
 
@@ -16,12 +23,29 @@ fluentd output plugin for post to [ChatWork](http://www.chatwork.com/)
16
23
 
17
24
  ## Configure
18
25
 
26
+ ### For non-buffered
27
+
28
+ ```
29
+ <match **>
30
+ @type chatwork
31
+ api_token YOUR_SECRET_TOKEN
32
+ room_id 0000000000
33
+ message Hello ChatWork!\n<%= record["value"] %>
34
+ </match>
35
+ ```
36
+
37
+ ### For buffered
38
+
19
39
  ```
20
40
  <match **>
21
41
  @type chatwork
22
42
  api_token YOUR_SECRET_TOKEN
23
43
  room_id 0000000000
24
44
  message Hello ChatWork!\n<%= record["value"] %>
45
+ buffered true
46
+ <buffer tag>
47
+ @type memory
48
+ </buffer>
25
49
  </match>
26
50
  ```
27
51
 
@@ -33,7 +57,9 @@ fluentd output plugin for post to [ChatWork](http://www.chatwork.com/)
33
57
  * message content
34
58
  * support erb format
35
59
  * support newline character (\n)
36
-
60
+ * buffered
61
+ * Switch non-buffered/buffered output
62
+
37
63
  ## Contributing
38
64
 
39
65
  1. Fork it ( https://github.com/sue445/fluent-plugin-chatwork/fork )
@@ -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-chatwork"
7
- spec.version = "2.0.1"
7
+ spec.version = "2.0.2"
8
8
  spec.authors = ["sue445"]
9
9
  spec.email = ["sue445@sue445.net"]
10
10
  spec.summary = %q{fluentd output plugin for post to chatwork}
@@ -31,7 +31,10 @@ module Fluent::Plugin
31
31
 
32
32
  # This method is called before starting.
33
33
  def configure(conf)
34
+ compat_parameters_convert(conf, :buffer)
34
35
  super
36
+
37
+ raise Fluent::ConfigError, "'tag' in chunk_keys is required." unless @chunk_key_tag
35
38
  end
36
39
 
37
40
  # This method is called when starting.
@@ -34,6 +34,25 @@ describe Fluent::Plugin::ChatworkOutput do
34
34
  end
35
35
  end
36
36
 
37
+ describe "lack of tag in chunk_keys" do
38
+ let(:config) do
39
+ Fluent::Config::Element.new(
40
+ 'ROOT', '', {
41
+ '@type' => 'charwork',
42
+ 'api_token' => 'xxxxxxxxxxxxxxxxxxxx',
43
+ 'room_id' => 1234567890,
44
+ 'message' => 'some message',
45
+ }, [
46
+ Fluent::Config::Element.new('buffer', 'mykey', {
47
+ 'chunk_keys' => 'mykey'
48
+ }, [])
49
+ ])
50
+ end
51
+ it "raises Fluent::ConfigError" do
52
+ expect { driver }.to raise_error(/'tag' in chunk_keys is required./)
53
+ end
54
+ end
55
+
37
56
  describe "#emit" do
38
57
  let(:record){ {} }
39
58
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-chatwork
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-14 00:00:00.000000000 Z
11
+ date: 2017-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd