fluent-plugin-mail 0.2.5 → 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 +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +7 -0
- data/{Gemfile.fluentd.lt.0.12 → Gemfile.0.12} +1 -1
- data/fluent-plugin-mail.gemspec +2 -2
- data/lib/fluent/plugin/out_mail.rb +3 -7
- data/test/plugin/test_out_mail.rb +21 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbf7a4f07a3e3bd983e19393c26f3308b09116b3
|
4
|
+
data.tar.gz: 97507f52cb2bf02faaf11f542956f2c83771028a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff14ea2b467ba371e6e86adc877a10e556db2f57a98511dec4677663e57108d1d1dbbaf6317c41d014344b8880b9c876aaaf19ed408f2d69cb9f28ae3f2ba4c2
|
7
|
+
data.tar.gz: 75f25d97a627d38818119f93c8d23f2b0813364626c7b5db475ea84310ca92f735c8a3c521cacd12f3a4a7764a62118ee3ea644824668c9119f9a90b342add54
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/fluent-plugin-mail.gemspec
CHANGED
@@ -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.
|
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, :
|
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, :
|
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, :
|
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.
|
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:
|
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:
|
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.
|
68
|
+
- Gemfile.0.12
|
69
69
|
- LICENSE
|
70
70
|
- README.md
|
71
71
|
- Rakefile
|