Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #4 from flipsasser/master

Howdy!
  • Loading branch information...
commit 54b244bda4c610e364ec214507b7a20cbdd27b33 2 parents 135f95b + 1569095
Richard Huang authored
7 lib/uniform_notifier/growl.rb
View
@@ -35,7 +35,7 @@ def self.setup_connection_growl( growl )
notify 'Uniform Notifier Growl has been turned on'
end
- def self.setup_connection_growl( growl )
+ def self.setup_connection_gntp( growl )
return unless growl
require 'ruby_gntp'
@password = growl.instance_of?(Hash) ? growl[:password] : nil
@@ -50,10 +50,9 @@ def self.setup_connection_growl( growl )
private
def self.notify( message )
- case @growl
- when Growl
+ if defined?(::Growl) && @growl.is_a?(::Growl)
@growl.notify( 'uniform_notifier', 'Uniform Notifier', message )
- when GNTP
+ elsif defined?(::GNTP) && @growl.is_a?(::GNTP)
@growl.notify({
:name => 'uniform_notifier',
:title => 'Uniform Notifier',
4 spec/uniform_notifier/growl_spec.rb
View
@@ -7,7 +7,7 @@
end
it "should notify growl without password" do
- growl = double('growl')
+ growl = double('growl', :is_a? => true)
Growl.should_receive(:new).with('localhost', 'uniform_notifier', ['uniform_notifier'], nil, nil).and_return(growl)
growl.should_receive(:notify).with('uniform_notifier', 'Uniform Notifier', 'Uniform Notifier Growl has been turned on').ordered
growl.should_receive(:notify).with('uniform_notifier', 'Uniform Notifier', 'notify growl without password').ordered
@@ -17,7 +17,7 @@
end
it "should notify growl with password" do
- growl = double('growl')
+ growl = double('growl', :is_a? => true)
Growl.should_receive(:new).with('localhost', 'uniform_notifier', ['uniform_notifier'], nil, '123456').and_return(growl)
growl.should_receive(:notify).with('uniform_notifier', 'Uniform Notifier', 'Uniform Notifier Growl has been turned on').ordered
growl.should_receive(:notify).with('uniform_notifier', 'Uniform Notifier', 'notify growl with password').ordered
Please sign in to comment.
Something went wrong with that request. Please try again.