fluent-plugin-hipchat 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +8 -0
- data/VERSION +1 -1
- data/lib/fluent/plugin/out_hipchat.rb +10 -2
- data/test/plugin/out_hipchat.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0e756826a6b4bd92bbd3d9a2424ff371e0d1c1e
|
4
|
+
data.tar.gz: 60e71c57bbed458a3e71b474b37e909b9d5c6d51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50fcf6280887ca8317a7dd873d18538c0c785fec290b9b5f2eb8866b0b22d70610f5215db40a90106f86a1d10cbaf21bb9d82f3a3d7743f3eea61c35b21096bd
|
7
|
+
data.tar.gz: dd5c67181bdc96fd2f79c80f15a887732948abfef8a75d349e42e089ebd7f2fadcf540066619e91b665e3d32318def24d0dffa7b11a478060debbd0d8973a9fc
|
data/README.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
@@ -44,7 +44,8 @@ module Fluent
|
|
44
44
|
def emit(tag, es, chain)
|
45
45
|
es.each {|time, record|
|
46
46
|
begin
|
47
|
-
send_message(record)
|
47
|
+
send_message(record) if record['message']
|
48
|
+
set_topic(record) if record['topic']
|
48
49
|
rescue => e
|
49
50
|
$log.error("HipChat Error: #{e} / #{e.message}")
|
50
51
|
end
|
@@ -54,7 +55,7 @@ module Fluent
|
|
54
55
|
def send_message(record)
|
55
56
|
room = record['room'] || @default_room
|
56
57
|
from = record['from'] || @default_from
|
57
|
-
message = record['message']
|
58
|
+
message = record['message']
|
58
59
|
if record['notify'].nil?
|
59
60
|
notify = @default_notify
|
60
61
|
else
|
@@ -64,5 +65,12 @@ module Fluent
|
|
64
65
|
message_format = FORMAT.include?(record['format']) ? record['format'] : @default_format
|
65
66
|
@hipchat.rooms_message(room, from, message, notify, color, message_format)
|
66
67
|
end
|
68
|
+
|
69
|
+
def set_topic(record)
|
70
|
+
room = record['room'] || @default_room
|
71
|
+
from = record['from'] || @default_from
|
72
|
+
topic = record['topic']
|
73
|
+
@hipchat.rooms_topic(room, topic, from)
|
74
|
+
end
|
67
75
|
end
|
68
76
|
end
|
data/test/plugin/out_hipchat.rb
CHANGED
@@ -77,6 +77,13 @@ class HipchatOutputTest < Test::Unit::TestCase
|
|
77
77
|
d.run
|
78
78
|
end
|
79
79
|
|
80
|
+
def test_topic
|
81
|
+
d = create_driver
|
82
|
+
stub(d.instance.hipchat).rooms_topic('testroom', 'foo', 'testuser')
|
83
|
+
d.emit({'topic' => 'foo'})
|
84
|
+
d.run
|
85
|
+
end
|
86
|
+
|
80
87
|
def test_color_validate
|
81
88
|
d = create_driver
|
82
89
|
stub(d.instance.hipchat).rooms_message('testroom', 'testuser', 'foo', 0, 'yellow', 'html')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-hipchat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuichi Tateno
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|