lib/safely/strategy/hoptoad.rb in safely-0.3.1 vs lib/safely/strategy/hoptoad.rb in safely-0.3.2

- old
+ new

@@ -4,25 +4,28 @@ class << self # Hoptoad API key to use for reporting errors attr_accessor :hoptoad_key - + attr_accessor :hoptoad_host + def load! begin require 'toadhopper' rescue LoadError $stderr.write( "'toadhopper' not available, safely cannot use the Hoptoad stategy" ) end end def report!( exception ) + params = {} + params[:notify_host] = self.hoptoad_host if !self.hoptoad_host.nil? + if defined?( Toadhopper ) && !self.hoptoad_key.nil? - Toadhopper( self.hoptoad_key ).post!( exception ) + Toadhopper.new(self.hoptoad_key, params).post!(exception) end end end - end end end