Sha256: d8ec93bef69360740ae64b63ce9a5f78286ec80e49f675d35e6a25ec7276a040

Contents?: true

Size: 465 Bytes

Versions: 33

Compression:

Stored size: 465 Bytes

Contents

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
    end
  end
end

Version data entries

33 entries across 33 versions & 5 rubygems

Version Path
relevance-tarantula-0.3.2 lib/relevance/tarantula/invalid_html_handler.rb
relevance-tarantula-0.3.3 lib/relevance/tarantula/invalid_html_handler.rb
romanbsd-tarantula-0.1.8 lib/relevance/tarantula/invalid_html_handler.rb
romanbsd-tarantula-0.2.0 lib/relevance/tarantula/invalid_html_handler.rb
tarantula-rails3-0.3.3 lib/relevance/tarantula/invalid_html_handler.rb
panmind-tarantula-0.3.3 lib/relevance/tarantula/invalid_html_handler.rb
tarantula-0.3.3 lib/relevance/tarantula/invalid_html_handler.rb
tarantula-0.0.5 lib/relevance/tarantula/invalid_html_handler.rb
tarantula-0.0.8.1 lib/relevance/tarantula/invalid_html_handler.rb
tarantula-0.2.0 lib/relevance/tarantula/invalid_html_handler.rb
tarantula-0.1.4 lib/relevance/tarantula/invalid_html_handler.rb
tarantula-0.1.5 lib/relevance/tarantula/invalid_html_handler.rb
tarantula-0.1.8 lib/relevance/tarantula/invalid_html_handler.rb