Permalink
Browse files

Requiring ruby-growl and xmpp4r only uf true on setup

  • Loading branch information...
1 parent a7fd30c commit 59ec703d67a7530abbe6c0c9a91741ea55e843f1 @tinogomes tinogomes committed Dec 14, 2010
View
@@ -1,28 +1,20 @@
PATH
remote: .
specs:
- uniform_notifier (0.0.1)
+ uniform_notifier (1.0.0)
GEM
remote: http://rubygems.org/
specs:
- diff-lcs (1.1.2)
- rspec (2.1.0)
- rspec-core (~> 2.1.0)
- rspec-expectations (~> 2.1.0)
- rspec-mocks (~> 2.1.0)
- rspec-core (2.1.0)
- rspec-expectations (2.1.0)
- diff-lcs (~> 1.1.2)
- rspec-mocks (2.1.0)
+ rspec (1.3.1)
ruby-growl (3.0)
xmpp4r (0.5)
PLATFORMS
ruby
DEPENDENCIES
- rspec
- ruby-growl
+ rspec (= 1.3.1)
+ ruby-growl (= 3.0)
uniform_notifier!
- xmpp4r
+ xmpp4r (= 0.5)
View
@@ -1,2 +1,5 @@
require 'bundler'
Bundler::GemHelper.install_tasks
+
+require "spec/rake/spectask"
+Spec::Rake::SpecTask.new
@@ -12,8 +12,9 @@ def self.out_of_channel_notify( message )
end
def self.setup_connection( growl )
+ return unless growl
require 'ruby-growl'
- @password = growl == true ? nil : growl[:password]
+ @password = growl.instance_of?(Hash) ? growl[:password] : nil
@growl = connect
notify 'Uniform Notifier Growl has been turned on'
@@ -35,4 +36,4 @@ def self.notify( message )
@growl.notify( 'uniform_notifier', 'Uniform Notifier', message )
end
end
-end
+end
@@ -1,3 +1,3 @@
module UniformNotifier
- VERSION = "1.0.0"
+ VERSION = "1.0.1"
end
@@ -14,6 +14,8 @@ def self.out_of_channel_notify( message )
end
def self.setup_connection( xmpp_information )
+ return unless xmpp_information
+
require 'xmpp4r'
@receiver = xmpp_information[:receiver]
@@ -47,4 +49,4 @@ def self.presence_status
Jabber::Presence.new.set_status( "Uniform Notifier started on #{Time.now}" )
end
end
-end
+end
View
@@ -1,4 +1,7 @@
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
require "uniform_notifier"
-require "rspec"
+require "rubygems"
+require "ruby-growl"
+require "xmpp4r"
+require "spec"
@@ -1,5 +1,4 @@
require 'spec_helper'
-require 'ruby-growl'
describe UniformNotifier::Growl do
@@ -1,5 +1,4 @@
require 'spec_helper'
-require 'xmpp4r'
describe UniformNotifier::Xmpp do
it "should not notify xmpp" do
View
@@ -14,9 +14,9 @@ Gem::Specification.new do |s|
s.rubyforge_project = "uniform_notifier"
- s.add_development_dependency "rspec"
- s.add_development_dependency "ruby-growl"
- s.add_development_dependency "xmpp4r"
+ s.add_development_dependency "ruby-growl", "3.0"
+ s.add_development_dependency "xmpp4r", "0.5"
+ s.add_development_dependency "rspec", "1.3.1"
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")

0 comments on commit 59ec703

Please sign in to comment.