fluent-plugin-typetalk 0.2.0 → 0.3.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
  SHA1:
3
- metadata.gz: d252f9a5dee6e9adc541582760c35c2e3e9e3455
4
- data.tar.gz: a8ddd3e4d03b98832717b4c91e14bcb066fb1b3a
3
+ metadata.gz: 6576cc5e44e99d90a0111df5b6fde318f29d4010
4
+ data.tar.gz: f45bcd3913761dd3e24b12e1ade58aca7fa3cc04
5
5
  SHA512:
6
- metadata.gz: 91d10213e890959d53dc7c18e1bfc63353d678e4d3459ff2b5bb72a95fe6cf7d2d3b3ee382e6c6ecbc4fc94e9aa3ad3e6cbe90b0e56c2fdab64e18a6068eec58
7
- data.tar.gz: 764b4d9c22cf8d34d5e34e5cd2c130531d8faf832afd71b5f36052a416522e64c86590b21c39983336f7351acb3feb4bcf838700e5f7fe52768e7f834e6ffd23
6
+ metadata.gz: 419b02e6c0ac6c0a9b94d93d1edbea34461a732ce6a54ce3a07cc16b0a34a1bff9c2ed209a16aa455022079e0d4cf24479c925aa1ff807caf81fe92b86e884e6
7
+ data.tar.gz: 5c926994d7043d7e5ee86a08a04db9ca10bbc4a02543b199172529b9402a5b68f280d9c577a57de6919e747bab9c74f8a88e44147ca6fb49505ce44eaa50dad1
@@ -3,7 +3,7 @@ $:.push File.expand_path('../lib', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = "fluent-plugin-typetalk"
6
- spec.version = "0.2.0"
6
+ spec.version = "0.3.0"
7
7
  spec.authors = ["tksmd","umakoz"]
8
8
  spec.email = ["someda@isenshi.com"]
9
9
  spec.description = %q{fluent plugin to send message to typetalk}
@@ -22,5 +22,5 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "test-unit-rr", ">= 1.0.5"
23
23
 
24
24
  spec.add_runtime_dependency "fluentd", [">= 0.14.0", "< 2"]
25
- spec.add_runtime_dependency "typetalk", ">= 0.0.6"
25
+ spec.add_runtime_dependency "typetalk", ">= 0.1.0"
26
26
  end
@@ -105,7 +105,7 @@ module Fluent::Plugin
105
105
  def send_message(tag, time, record)
106
106
  message = evaluate_message(tag, time, record)
107
107
  begin
108
- @typetalk.post_message(@topic_id, message)
108
+ @typetalk.post_message(@topic_id, message, {show_link_meta: false})
109
109
  rescue Typetalk::Unauthorized
110
110
  raise TypetalkError, "invalid credentials used. check client_id and client_secret in your configuration."
111
111
  rescue => e
@@ -71,7 +71,7 @@ class TypetalkOutputTest < Test::Unit::TestCase
71
71
 
72
72
  def test_write
73
73
  d = create_driver()
74
- mock(d.instance.typetalk).post_message(1, 'notice : test1')
74
+ mock(d.instance.typetalk).post_message(1, 'notice : test1', {show_link_meta: false})
75
75
  d.run(default_tag: "test") do
76
76
  d.feed({'message' => 'test1'})
77
77
  end
@@ -81,7 +81,7 @@ class TypetalkOutputTest < Test::Unit::TestCase
81
81
  d = create_driver()
82
82
  d.instance.message = "notice : %s [%s]"
83
83
  d.instance.out_keys = ["message", "time"]
84
- mock(d.instance.typetalk).post_message(1, "notice : test1 [1399910738]")
84
+ mock(d.instance.typetalk).post_message(1, "notice : test1 [1399910738]", {show_link_meta: false})
85
85
 
86
86
  ENV["TZ"]="Asia/Tokyo"
87
87
  t = Time.strptime('2014-05-13 01:05:38', '%Y-%m-%d %T')
@@ -92,7 +92,7 @@ class TypetalkOutputTest < Test::Unit::TestCase
92
92
 
93
93
  def test_post_message_unauthorized_error
94
94
  d = create_driver()
95
- stub(d.instance.typetalk).post_message(1, 'notice : test1') {
95
+ stub(d.instance.typetalk).post_message(1, 'notice : test1', {show_link_meta: false}) {
96
96
  raise Typetalk::Unauthorized, {status:401, headers:{}, body:''}.to_json
97
97
  }
98
98
  stub(d.instance.log).error {|name, params|
@@ -107,7 +107,7 @@ class TypetalkOutputTest < Test::Unit::TestCase
107
107
 
108
108
  def test_post_message_invalid_request_error
109
109
  d = create_driver()
110
- stub(d.instance.typetalk).post_message(1, 'notice : test1') {
110
+ stub(d.instance.typetalk).post_message(1, 'notice : test1', {show_link_meta: false}) {
111
111
  raise Typetalk::InvalidRequest, {status:400, headers:{}, body:'{"error":"invalid_client", "error_description":""}'}.to_json
112
112
  }
113
113
  stub(d.instance.log).error {|name, params|
@@ -122,7 +122,7 @@ class TypetalkOutputTest < Test::Unit::TestCase
122
122
 
123
123
  def test_post_message_maxlength_error
124
124
  d = create_driver()
125
- stub(d.instance.typetalk).post_message(1, 'notice : test1') {
125
+ stub(d.instance.typetalk).post_message(1, 'notice : test1', {show_link_meta: false}) {
126
126
  raise Typetalk::InvalidRequest, {status:400, headers:{}, body:'{"errors":[{"field":"message", "name":"error.maxLength", "message":"Maximum length is 4,096 characters."}]}'}.to_json
127
127
  }
128
128
  stub(d.instance.log).error {|name, params|
@@ -137,7 +137,7 @@ class TypetalkOutputTest < Test::Unit::TestCase
137
137
 
138
138
  def test_post_message_notfound_error
139
139
  d = create_driver()
140
- stub(d.instance.typetalk).post_message(1, 'notice : test1') {
140
+ stub(d.instance.typetalk).post_message(1, 'notice : test1', {show_link_meta: false}) {
141
141
  raise Typetalk::NotFound, {status:404, headers:{}, body:'{"errors":[]}'}.to_json
142
142
  }
143
143
  stub(d.instance.log).error {|name, params|
@@ -152,7 +152,7 @@ class TypetalkOutputTest < Test::Unit::TestCase
152
152
 
153
153
  def test_oauth2_error
154
154
  d = create_driver()
155
- stub(d.instance.typetalk).post_message(1, 'notice : test1') {
155
+ stub(d.instance.typetalk).post_message(1, 'notice : test1', {show_link_meta: false}) {
156
156
  raise Typetalk::InvalidRequest, {status:400, headers:'{"www-authenticate": "Bearer error=\"invalid_scope\""}', body:""}.to_json
157
157
  }
158
158
  stub(d.instance.log).error {|name, params|
@@ -167,8 +167,8 @@ class TypetalkOutputTest < Test::Unit::TestCase
167
167
 
168
168
  def test_throttle
169
169
  d = create_driver(CONFIG_THROTTLE)
170
- mock(d.instance.typetalk).post_message(1, 'notice : test1')
171
- mock(d.instance.typetalk).post_message(1, 'notice : test3')
170
+ mock(d.instance.typetalk).post_message(1, 'notice : test1', {show_link_meta: false})
171
+ mock(d.instance.typetalk).post_message(1, 'notice : test3', {show_link_meta: false})
172
172
  stub(d.instance.log).error {|name, params|
173
173
  assert_equal "out_typetalk:", name
174
174
  assert_equal "number of posting message within 5.0(sec) reaches to the limit 1", params[:error]
@@ -183,9 +183,9 @@ class TypetalkOutputTest < Test::Unit::TestCase
183
183
 
184
184
  def test_truncate
185
185
  d = create_driver(CONFIG_TRUNCATE)
186
- mock(d.instance.typetalk).post_message(1, '1')
187
- mock(d.instance.typetalk).post_message(1, '1'*3999)
188
- mock(d.instance.typetalk).post_message(1, '1'*3995 + ' ...')
186
+ mock(d.instance.typetalk).post_message(1, '1', {show_link_meta: false})
187
+ mock(d.instance.typetalk).post_message(1, '1'*3999, {show_link_meta: false})
188
+ mock(d.instance.typetalk).post_message(1, '1'*3995 + ' ...', {show_link_meta: false})
189
189
  d.run(default_tag: "test") do
190
190
  d.feed({'message' => '1'})
191
191
  d.feed({'message' => '1'*3999}) # not truncated
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-typetalk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - tksmd
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-09-14 00:00:00.000000000 Z
12
+ date: 2017-10-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -93,14 +93,14 @@ dependencies:
93
93
  requirements:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: 0.0.6
96
+ version: 0.1.0
97
97
  type: :runtime
98
98
  prerelease: false
99
99
  version_requirements: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 0.0.6
103
+ version: 0.1.0
104
104
  description: fluent plugin to send message to typetalk
105
105
  email:
106
106
  - someda@isenshi.com