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 CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env ruby
1
2
  # -*- coding: utf-8 -*-
2
3
 
3
4
  require File.dirname(__FILE__) + '/../lib/growl-logger'
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.2'
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 "localhost", @name, ["log"]
26
+ @growl = Growl.new host, @name, ["log"]
26
27
  rescue LoadError
27
28
  end
28
29
  end
@@ -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.2
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-26 00:00:00 +09:00
12
+ date: 2009-03-27 00:00:00 +09:00
13
13
  default_executable:
14
14
  dependencies: []
15
15