fluent-plugin-hipchat 0.1.3 → 0.1.4

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: d0e756826a6b4bd92bbd3d9a2424ff371e0d1c1e
4
- data.tar.gz: 60e71c57bbed458a3e71b474b37e909b9d5c6d51
3
+ metadata.gz: 05583b44258b849316908fb2876939ac01ec29b3
4
+ data.tar.gz: 77b650a614878b2abdfdf3bb27ccc37876c935eb
5
5
  SHA512:
6
- metadata.gz: 50fcf6280887ca8317a7dd873d18538c0c785fec290b9b5f2eb8866b0b22d70610f5215db40a90106f86a1d10cbaf21bb9d82f3a3d7743f3eea61c35b21096bd
7
- data.tar.gz: dd5c67181bdc96fd2f79c80f15a887732948abfef8a75d349e42e089ebd7f2fadcf540066619e91b665e3d32318def24d0dffa7b11a478060debbd0d8973a9fc
6
+ metadata.gz: bee6c20e5389de9d77134d07f402d0f57a58eb7930369b820155b30b766f5b09fcd01cb77588894c0b6dfcff9def758489a13c44a63dbe8df77924415f113e66
7
+ data.tar.gz: e26c011ea2707f9c401e4f99ef1f775fcf9e07854e4363bf8c1275f415933cdbb121a444b381a4642f7bd88a07b43b23a8e38562f9a8cea404d559dcd439112d
data/.travis.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  rvm:
2
- - 1.9.2
3
2
  - 1.9.3
3
+ - 2.0.0
4
4
 
5
5
  script: bundle exec rake test
data/README.rdoc CHANGED
@@ -1,5 +1,7 @@
1
1
  = Fluent event to hipchat plugin.
2
2
 
3
+ {<img src="https://travis-ci.org/hotchpotch/fluent-plugin-hipchat.png?branch=master" alt="Build Status" />}[https://travis-ci.org/hotchpotch/fluent-plugin-hipchat]
4
+
3
5
  = Installation
4
6
 
5
7
  $ fluent-gem install fluent-plugin-hipchat
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Fluent
3
- class HipchatOutput < Output
3
+ class HipchatOutput < BufferedOutput
4
4
  COLORS = %w(yellow red green purple gray random)
5
5
  FORMAT = %w(html text)
6
6
  Fluent::Plugin.register_output('hipchat', self)
@@ -15,6 +15,7 @@ module Fluent
15
15
  config_param :http_proxy_port, :integer, :default => nil
16
16
  config_param :http_proxy_user, :string, :default => nil
17
17
  config_param :http_proxy_pass, :string, :default => nil
18
+ config_param :flush_interval, :time, :default => 1
18
19
 
19
20
  attr_reader :hipchat
20
21
 
@@ -41,15 +42,19 @@ module Fluent
41
42
  end
42
43
  end
43
44
 
44
- def emit(tag, es, chain)
45
- es.each {|time, record|
45
+ def format(tag, time, record)
46
+ [tag, time, record].to_msgpack
47
+ end
48
+
49
+ def write(chunk)
50
+ chunk.msgpack_each do |(tag,time,record)|
46
51
  begin
47
52
  send_message(record) if record['message']
48
53
  set_topic(record) if record['topic']
49
54
  rescue => e
50
55
  $log.error("HipChat Error: #{e} / #{e.message}")
51
56
  end
52
- }
57
+ end
53
58
  end
54
59
 
55
60
  def send_message(record)
@@ -2,20 +2,6 @@ require 'test_helper'
2
2
  require 'fluent/plugin/out_hipchat'
3
3
 
4
4
  class HipchatOutputTest < Test::Unit::TestCase
5
- class OutputTestDriver < Fluent::Test::InputTestDriver
6
- def initialize(klass, tag='test', &block)
7
- super(klass, &block)
8
- @tag = tag
9
- end
10
-
11
- attr_accessor :tag
12
-
13
- def emit(record, time=Time.now)
14
- es = Fluent::OneEventStream.new(time.to_i, record)
15
- @instance.emit(@tag, es, nil)
16
- end
17
- end
18
-
19
5
  def setup
20
6
  super
21
7
  Fluent::Test.setup
@@ -37,7 +23,7 @@ class HipchatOutputTest < Test::Unit::TestCase
37
23
  ]
38
24
 
39
25
  def create_driver(conf = CONFIG)
40
- OutputTestDriver.new(Fluent::HipchatOutput) {
26
+ Fluent::Test::BufferedOutputTestDriver.new(Fluent::HipchatOutput) {
41
27
  }.configure(conf)
42
28
  end
43
29
 
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.3
4
+ version: 0.1.4
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-10-07 00:00:00.000000000 Z
11
+ date: 2014-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  version: '0'
131
131
  requirements: []
132
132
  rubyforge_project:
133
- rubygems_version: 2.0.0
133
+ rubygems_version: 2.0.3
134
134
  signing_key:
135
135
  specification_version: 4
136
136
  summary: fluent HipChat plugin