lib/cohesion.rb in cohesion-0.0.4 vs lib/cohesion.rb in cohesion-0.0.5
- old
+ new
@@ -64,11 +64,10 @@
end
end
end
def self.site(url, options={})
- puts "alsjflsadjg"
errors = []
failures = []
statistics = CobwebCrawler.new({:cache => 3600, :cache_type => :full, :crawl_linked_external => true, :store_refered_url => true}.merge(options)).crawl(url) do |page|
print page[:url]
if page[:status_code] > 399
@@ -82,12 +81,16 @@
if failures.count == 0
puts "All links working!"
else
puts "Failed urls:"
failures.each do |f|
- puts " - #{f[:url]} [ #{f[:status_code]} ]"
- puts statistics.inbound_links_for(f[:url])
+ puts ""
+ puts "#{f[:url]} [ #{f[:status_code]} ]"
+ statistics.inbound_links_for(f[:url]).each do |inbound_link|
+ puts " - #{inbound_link}"
+ end
end
+ puts ""
end
puts
failures
end