lib/relevance/tarantula/invalid_html_handler.rb in tarantula-0.3.3 vs lib/relevance/tarantula/invalid_html_handler.rb in tarantula-0.4.0
- old
+ new
@@ -1,18 +1,24 @@
-class Relevance::Tarantula::InvalidHtmlHandler
- include Relevance::Tarantula
- def handle(result)
- response = result.response
- return unless response.html?
- begin
- body = HTML::Document.new(response.body, true)
- rescue Exception => e
- error_result = result.dup
- error_result.success = false
- error_result.description = "Bad HTML (Scanner)"
- error_result.data = e.message
- error_result
- else
- nil
+module Relevance
+ module Tarantula
+
+ class InvalidHtmlHandler
+ include Relevance::Tarantula
+ def handle(result)
+ response = result.response
+ return unless response.html?
+ begin
+ body = HTML::Document.new(response.body, true)
+ rescue Exception => e
+ error_result = result.dup
+ error_result.success = false
+ error_result.description = "Bad HTML (Scanner)"
+ error_result.data = e.message
+ error_result
+ else
+ nil
+ end
+ end
end
+
end
end