lib/stalker.rb in stalker-0.2.3 vs lib/stalker.rb in stalker-0.2.4

- old
+ new

@@ -91,18 +91,18 @@ def beanstalk @@beanstalk ||= Beanstalk::Pool.new([ beanstalk_host_and_port ]) end def beanstalk_url - ENV['BEANSTALK_URL'] || 'beanstalk://localhost:11300/' + ENV['BEANSTALK_URL'] || 'beanstalk://localhost/' end class BadURL < RuntimeError; end def beanstalk_host_and_port uri = URI.parse(beanstalk_url) raise(BadURL, beanstalk_url) if uri.scheme != 'beanstalk' - return "#{uri.host}:#{uri.port}" + return "#{uri.host}:#{uri.port || 11300}" end def exception_message(e) msg = [ "Exception #{e.class} -> #{e.message}" ]