fluent-plugin-growl 0.0.1 → 0.0.2

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.
Files changed (4) hide show
  1. data/README +22 -24
  2. data/VERSION +1 -1
  3. data/lib/fluent/plugin/out_growl.rb +4 -3
  4. metadata +3 -3
data/README CHANGED
@@ -3,29 +3,27 @@ Growl Notification Output Plugin
3
3
  First, you must set up growl can "Listen for incoming notifications" at "Growl" in "System Preferences".
4
4
 
5
5
  fluent.conf example:
6
- =====
7
- <match growl.**>
8
- type growl
9
-
10
- server localhost
11
- #password fluent
12
- appname Fluent Growl Notify
13
-
14
- <notify>
15
- name Notify
16
- priority 0
17
- sticky false
18
- </notify>
19
-
20
- <notify>
21
- name StickyNotify
22
- priority 0
23
- sticky true
24
- </notify>
25
- </match>
26
- =====
6
+ <match growl.**>
7
+ type growl
8
+
9
+ server localhost
10
+ #password fluent
11
+ appname Fluent Growl Notify
12
+
13
+ <notify>
14
+ name Notify
15
+ priority 0
16
+ sticky false
17
+ </notify>
18
+
19
+ <notify>
20
+ name StickyNotify
21
+ priority 0
22
+ sticky true
23
+ </notify>
24
+ </match>
27
25
 
28
26
  and some command line example
29
- $ echo '{"title": "Title", "message": "Hello World!!"}' | fluent-cat growl.test
30
- $ echo '{"title": "Sticky", "message": "It's sticky message!!", notify:"StickyNotify"}' | fluent-cat growl.test
31
- $ echo '{}' | fluent-cat growl.test
27
+ $ echo '{"title": "Title", "message": "Hello World!!"}' | fluent-cat growl.test
28
+ $ echo '{"title": "Sticky", "message": "It's sticky message!!", notify:"StickyNotify"}' | fluent-cat growl.test
29
+ $ echo '{}' | fluent-cat growl.test
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -11,6 +11,7 @@ module Fluent
11
11
  DEFAULT_PASSWORD = nil
12
12
  DEFAULT_APPNAME = "Fluent Growl Notification"
13
13
  DEFAULT_NOTIFICATION_NAME = "Fluent Defalt Notification"
14
+ DEFAULT_TITLE = "Fluent Notification"
14
15
 
15
16
  def initialize
16
17
  @growl
@@ -31,19 +32,19 @@ module Fluent
31
32
  end
32
33
  priority = e['priority'].to_i
33
34
  sticky = (e.has_key? "sticky") && (e["sticky"].match /y(es)?|on|true/i ) && true
34
- @notifies[name] = {:priority => priority, :sticky => sticky}
35
+ @notifies[name] = { :priority => priority, :sticky => sticky }
35
36
  }
36
37
  # if @notifies.empty?
37
38
  # raise ConfigError, "At least one <notify> directive is needed"
38
39
  # end
39
- @notifies[DEFAULT_NOTIFICATION_NAME] = {:priority => 0, :sticky => false}
40
+ @notifies[DEFAULT_NOTIFICATION_NAME] = { :priority => 0, :sticky => false }
40
41
 
41
42
  @growl = Growl.new server, appname, @notifies.keys, nil, password
42
43
  end
43
44
 
44
45
  def emit(tag, es, chain)
45
46
  es.each{|e|
46
- title = e.record["title"] || "Fluent Notification"
47
+ title = e.record["title"] || DEFAULT_TITLE
47
48
  message = e.record["message"] || "#{e.record.to_json} at #{Time.at(e.time).localtime}"
48
49
  notifyname = e.record["notify"] || DEFAULT_NOTIFICATION_NAME
49
50
  notify = @notifies[notifyname]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - TAKEI Yuya
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-09-30 00:00:00 +09:00
17
+ date: 2011-10-06 00:00:00 +09:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency