lib/sinatra/toadhopper.rb in toadhopper-sinatra-0.6 vs lib/sinatra/toadhopper.rb in toadhopper-sinatra-0.7
- old
+ new
@@ -4,11 +4,11 @@
module Sinatra
# The Toadhopper helper methods
module Toadhopper
# Reports the current sinatra error to Hoptoad
def post_error_to_hoptoad!
- options.toadhopper.each_pair {|k, v| ::Toadhopper.__send__("#{k}=", v)}
+ options.toadhopper.each_pair {|k, v| ::Toadhopper.__send__("#{k}=", v)} if options.respond_to?(:toadhopper)
unless ::Toadhopper.api_key
STDERR.puts "WARNING: Ignoring hoptoad notification - :api_key not set"
return
end
::Toadhopper.post!(
@@ -27,10 +27,7 @@
},
{'X-Hoptoad-Client-Name' => 'toadhopper-sinatra'}
)
end
end
- def self.registered(app)
- app.set :hoptoad, {}
- end
helpers Toadhopper
-end
+end
\ No newline at end of file