lib/tasks/check.rake in cohesion-0.0.1 vs lib/tasks/check.rake in cohesion-0.0.2

- old
+ new

@@ -4,30 +4,10 @@ task :check, :url do | t, args | if args[:url].nil? puts puts "Usage: rake cohesion:check[url] (eg: check_links[\"http://rubyonrails.org/\"])" else - errors = [] - failures = [] - CobwebCrawler.new(:cache => 600, :cache_type => :full, :crawl_linked_external => true).crawl(args[:url]) do |page| - print page[:url] - if page[:status_code] > 399 - puts " [#{page[:status_code]}] \e[31m\u2717\e[0m" - failures << page - else - puts " \e[32m\u2713\e[0m" - end - end - - puts - if failures.count == 0 - puts "All links working!" - else - puts "Failed urls:" - - failures.map{|f| puts " - #{f[:url]} [ #{f[:status_code]} ]"} - puts - end + Cohesion::Check.site(args[:url]) end puts end end \ No newline at end of file