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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4bd106249ecd58d1ec8dc594d23578c96c3ccce8
4
- data.tar.gz: a7c4e245450152feae2ee4ec671e783f2a793e6e
3
+ metadata.gz: d0e756826a6b4bd92bbd3d9a2424ff371e0d1c1e
4
+ data.tar.gz: 60e71c57bbed458a3e71b474b37e909b9d5c6d51
5
5
  SHA512:
6
- metadata.gz: 848d662f54e466e5ae0bfcd7d9d7c1adca6345bcc477c9dc06a469cec09b1ddbce7aec3bb3a8d57ec84c1e229def11f9338b73ef4cb0bca075d01cb0e0e409ab
7
- data.tar.gz: 78f25618a65ba3cd31e3ab7b0e3158be74c7cb8a4e248a9778ce77ef5acd4ca3b46a40d842de8a829fcfc97a2f663dff93f26378dcb964837ee65fa2ee284ffd
6
+ metadata.gz: 50fcf6280887ca8317a7dd873d18538c0c785fec290b9b5f2eb8866b0b22d70610f5215db40a90106f86a1d10cbaf21bb9d82f3a3d7743f3eea61c35b21096bd
7
+ data.tar.gz: dd5c67181bdc96fd2f79c80f15a887732948abfef8a75d349e42e089ebd7f2fadcf540066619e91b665e3d32318def24d0dffa7b11a478060debbd0d8973a9fc
data/README.rdoc CHANGED
@@ -31,6 +31,14 @@
31
31
  :format => 'text',
32
32
  })
33
33
 
34
+ # set topic
35
+ fluent_logger.post('hipchat', {
36
+ :from => 'alice',
37
+ :topic => 'new topic',
38
+ :room => 'my_room',
39
+ })
40
+
41
+
34
42
  = Copyright
35
43
 
36
44
  Copyright:: Copyright (c) 2012- Yuichi Tateno
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
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
@@ -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.2
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-09-10 00:00:00.000000000 Z
11
+ date: 2013-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd