Sha256: 326e3ef868360038b969fcb80b2a9280dd8809ffddc943704df90c1e07963702

Contents?: true

Size: 563 Bytes

Versions: 1

Compression:

Stored size: 563 Bytes

Contents

#!/usr/bin/env ruby

$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require 'broken_link_finder'
require 'thor'

class BrokenLinkFinderCLI < Thor
  desc 'crawl [URL]', 'Find broken links at the URL'
  option :recursive, type: :boolean, aliases: [:r], desc: 'Crawl the entire site'
  def crawl(url)
    url = "http://#{url}" unless url.start_with?('http')
    finder = BrokenLinkFinder::Finder.new
    options[:recursive] ? finder.crawl_site(url) : finder.crawl_page(url)
    finder.pretty_print_link_summary
  end
end

BrokenLinkFinderCLI.start(ARGV)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
broken_link_finder-0.6.0 exe/broken_link_finder