fluent-plugin-mail 0.2.5 → 0.3.0

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: ce1428de5b8be38c7464d257acd907a57384eb7d
4
- data.tar.gz: fed5e53b42c11b651559518f9680dde038b3c575
3
+ metadata.gz: bbf7a4f07a3e3bd983e19393c26f3308b09116b3
4
+ data.tar.gz: 97507f52cb2bf02faaf11f542956f2c83771028a
5
5
  SHA512:
6
- metadata.gz: cd49b7942e142649291f7b33cdaff7e6d0bae71aa49d875b270ae3d0dd03c0b69d6769186ae5b66089a39c38476e90e60c0d4879c97929c681a8e5e340139cac
7
- data.tar.gz: 3d4281ab00c49b97a49ec2000d8a3e7aecf3e83fed8a3163a331cc481b82458ddd3c95648696e248f0b9e919738793c57e19766d5d2e044c861467d589bb4dca
6
+ metadata.gz: ff14ea2b467ba371e6e86adc877a10e556db2f57a98511dec4677663e57108d1d1dbbaf6317c41d014344b8880b9c876aaaf19ed408f2d69cb9f28ae3f2ba4c2
7
+ data.tar.gz: 75f25d97a627d38818119f93c8d23f2b0813364626c7b5db475ea84310ca92f735c8a3c521cacd12f3a4a7764a62118ee3ea644824668c9119f9a90b342add54
@@ -4,5 +4,5 @@ rvm:
4
4
  - 2.4.*
5
5
  gemfile:
6
6
  - Gemfile
7
- - Gemfile.fluentd.lt.0.12
7
+ - Gemfile.0.12
8
8
  before_install: gem update bundler
@@ -1,3 +1,10 @@
1
+ # 0.3.0 (2017-11-25)
2
+
3
+ Changes:
4
+
5
+ * Drop Fluentd v0.10 support
6
+ * Use array type for array like parameters (thanks to @cosmo0920)
7
+
1
8
  # 0.2.5 (2017-11-25)
2
9
 
3
10
  Enhancements:
@@ -1,4 +1,4 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem 'fluentd', '~> 0.10.43'
4
3
  gemspec
4
+ gem 'fluentd', '~> 0.12.0'
@@ -11,10 +11,10 @@ Gem::Specification.new do |gem|
11
11
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
12
12
  gem.name = "fluent-plugin-mail"
13
13
  gem.require_paths = ["lib"]
14
- gem.version = '0.2.5'
14
+ gem.version = '0.3.0'
15
15
  gem.license = "Apache-2.0"
16
16
 
17
- gem.add_runtime_dependency "fluentd"
17
+ gem.add_runtime_dependency "fluentd", '>= 0.12.0'
18
18
  gem.add_runtime_dependency "string-scrub" if RUBY_VERSION.to_f < 2.1
19
19
  gem.add_development_dependency "rake"
20
20
  gem.add_development_dependency "test-unit"
@@ -17,11 +17,11 @@ class Fluent::MailOutput < Fluent::Output
17
17
  end
18
18
 
19
19
  desc "Output comma delimited keys"
20
- config_param :out_keys, :string, :default => ""
20
+ config_param :out_keys, :array, :default => []
21
21
  desc "Format string to construct message body"
22
22
  config_param :message, :string, :default => nil
23
23
  desc "Specify comma delimited keys output to `message`"
24
- config_param :message_out_keys, :string, :default => ""
24
+ config_param :message_out_keys, :array, :default => []
25
25
  desc "Identify the timestamp of the record"
26
26
  config_param :time_key, :string, :default => nil
27
27
  desc "Identify the tag of the record"
@@ -55,7 +55,7 @@ class Fluent::MailOutput < Fluent::Output
55
55
  desc "Format string to construct mail subject"
56
56
  config_param :subject, :string, :default => 'Fluent::MailOutput plugin'
57
57
  desc "Specify comma delimited keys output to `subject`"
58
- config_param :subject_out_keys, :string, :default => ""
58
+ config_param :subject_out_keys, :array, :default => []
59
59
  desc "If set to true, enable STARTTLS"
60
60
  config_param :enable_starttls_auto, :bool, :default => false
61
61
  desc "If set to true, enable TLS"
@@ -78,10 +78,6 @@ class Fluent::MailOutput < Fluent::Output
78
78
  def configure(conf)
79
79
  super
80
80
 
81
- @out_keys = @out_keys.split(',')
82
- @message_out_keys = @message_out_keys.split(',')
83
- @subject_out_keys = @subject_out_keys.split(',')
84
-
85
81
  if @out_keys.empty? and @message.nil?
86
82
  raise Fluent::ConfigError, "Either 'message' or 'out_keys' must be specifed."
87
83
  end
@@ -60,6 +60,19 @@ class MailOutputTest < Test::Unit::TestCase
60
60
  cc_key cc
61
61
  bcc_key bcc
62
62
  ]
63
+ CONFIG_KEYS_WITH_WHITESPACES = %[
64
+ out_keys tag,time, value
65
+ time_key time
66
+ time_format %Y/%m/%d %H:%M:%S
67
+ tag_key tag
68
+ message_out_keys msg, log_level
69
+ subject Fluentd Notification Alarm %s
70
+ subject_out_keys tag, content_id
71
+ host localhost
72
+ port 25
73
+ from localhost@localdomain
74
+ to localhost@localdomain
75
+ ]
63
76
 
64
77
  def create_driver(conf=CONFIG_OUT_KEYS,tag='test')
65
78
  Fluent::Test::OutputTestDriver.new(Fluent::MailOutput, tag).configure(conf)
@@ -68,10 +81,18 @@ class MailOutputTest < Test::Unit::TestCase
68
81
  def test_configure
69
82
  d = create_driver(CONFIG_OUT_KEYS)
70
83
  assert_equal 'localhost', d.instance.host
84
+ assert_equal ['tag', 'time', 'value'], d.instance.out_keys
71
85
  d = create_driver(CONFIG_CC_BCC)
72
86
  assert_equal 'localhost', d.instance.host
87
+ assert_equal ['tag', 'time', 'value'], d.instance.out_keys
73
88
  d = create_driver(CONFIG_MESSAGE)
74
89
  assert_equal 'localhost', d.instance.host
90
+ assert_equal ['tag', 'time', 'value'], d.instance.message_out_keys
91
+ d = create_driver(CONFIG_KEYS_WITH_WHITESPACES)
92
+ assert_equal 'localhost', d.instance.host
93
+ assert_equal ['tag', 'time', 'value'], d.instance.out_keys
94
+ assert_equal ['tag', 'content_id'], d.instance.subject_out_keys
95
+ assert_equal ['msg', 'log_level'], d.instance.message_out_keys
75
96
  end
76
97
 
77
98
  def test_out_keys
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-mail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuichi UEMURA
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '0'
20
+ version: 0.12.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: '0'
27
+ version: 0.12.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -65,7 +65,7 @@ files:
65
65
  - ".travis.yml"
66
66
  - CHANGELOG.md
67
67
  - Gemfile
68
- - Gemfile.fluentd.lt.0.12
68
+ - Gemfile.0.12
69
69
  - LICENSE
70
70
  - README.md
71
71
  - Rakefile