lib/relevance/tarantula/crawler.rb in relevance-tarantula-0.3.2 vs lib/relevance/tarantula/crawler.rb in relevance-tarantula-0.3.3
- old
+ new
@@ -36,10 +36,12 @@
]
@reporters = [Relevance::Tarantula::IOReporter.new($stderr)]
@decoder = HTMLEntities.new
@times_to_crawl = 1
@fuzzers = [Relevance::Tarantula::FormSubmission]
+
+ @stdout_tty = $stdout.tty?
end
def method_missing(meth, *args)
super unless Result::ALLOW_NNN_FOR =~ meth.to_s
@response_code_handler.send(meth, *args)
@@ -59,10 +61,11 @@
queue_link url
begin
do_crawl num
rescue CrawlTimeout => e
+ puts
puts e.message
end
puts "#{(num+1).ordinalize} crawl" if @times_to_crawl > 1
@@ -236,10 +239,10 @@
total_links_count - links_remaining_count
end
def blip(number = 0)
unless verbose
- print "\r #{links_completed_count} of #{total_links_count} links completed " if $stdout.tty?
+ print "\r #{links_completed_count} of #{total_links_count} links completed " if @stdout_tty
timeout_if_too_long(number)
end
end
def timeout_if_too_long(number = 0)