growl-logger 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/examples/example.rb +1 -0
- data/lib/growl-logger.rb +4 -3
- data/spec/growl-logger_spec.rb +1 -1
- metadata +2 -2
data/examples/example.rb
CHANGED
data/lib/growl-logger.rb
CHANGED
@@ -3,11 +3,12 @@ require 'rubygems'
|
|
3
3
|
require 'logger'
|
4
4
|
|
5
5
|
class GrowlLogger < Logger
|
6
|
-
VERSION = '0.1.
|
6
|
+
VERSION = '0.1.3'
|
7
7
|
|
8
8
|
def initialize(args = {})
|
9
9
|
super(GrowlLogger::LogDevice.new(
|
10
10
|
args[:name] || 'growl-logger',
|
11
|
+
args[:host] || 'localhost',
|
11
12
|
args[:growlnotify] || false
|
12
13
|
))
|
13
14
|
self.level = args[:level] if args[:level]
|
@@ -16,13 +17,13 @@ class GrowlLogger < Logger
|
|
16
17
|
end
|
17
18
|
|
18
19
|
class LogDevice
|
19
|
-
def initialize(name, growlnotify_mode = true, &block)
|
20
|
+
def initialize(name, host, growlnotify_mode = true, &block)
|
20
21
|
@name = name
|
21
22
|
@growlnotify_mode = growlnotify_mode
|
22
23
|
unless @growlnotify_mode
|
23
24
|
begin
|
24
25
|
require 'ruby-growl'
|
25
|
-
@growl = Growl.new
|
26
|
+
@growl = Growl.new host, @name, ["log"]
|
26
27
|
rescue LoadError
|
27
28
|
end
|
28
29
|
end
|
data/spec/growl-logger_spec.rb
CHANGED
@@ -48,7 +48,7 @@ describe GrowlLogger do
|
|
48
48
|
end
|
49
49
|
|
50
50
|
it 'get_priority' do
|
51
|
-
logdev = GrowlLogger::LogDevice.new('foo')
|
51
|
+
logdev = GrowlLogger::LogDevice.new('foo', 'localhost')
|
52
52
|
logdev.get_priority('DEBUG: test').should == -2
|
53
53
|
logdev.get_priority('INFO: test').should == -1
|
54
54
|
logdev.get_priority('WARN: test').should == 0
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: growl-logger
|
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
|
- jugyo
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-03-
|
12
|
+
date: 2009-03-27 00:00:00 +09:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|