Sha256: 27af2fb5b66bf24cc29902bf901eafa9942bfd11d9d51cfc2775586f2f4b5a12

Contents?: true

Size: 1.18 KB

Versions: 1

Compression:

Stored size: 1.18 KB

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'bundler/setup'
require 'pry'
require 'byebug'
require 'logger'
require 'httplog'
require 'broken_link_finder'

logger = Logger.new(STDOUT)
logger.formatter = proc do |_severity, _datetime, _progname, msg|
  "#{msg}\n"
end

# Monkey patch all Net:HTTP network calls and log them.
HttpLog.configure do |config|
  config.enabled        = true
  config.logger         = logger

  config.log_connect    = false
  config.log_request    = true
  config.log_headers    = false
  config.log_data       = false
  config.log_status     = true
  config.log_response   = false
  config.log_benchmark  = false

  config.compact_log    = false
  config.json_log       = false
end

# Call reload to load all recent code changes.
def reload
  original_verbose = $VERBOSE
  $VERBOSE = nil # Temporarily suppress ruby warnings.
  load 'load.rb'
  include BrokenLinkFinder
  $VERBOSE = original_verbose # Restore ruby warnings.
  true
end

# You can add fixtures and/or initialization code here...
reload

url = 'http://txti.es/'
by_page = Finder.new
by_link = Finder.new sort: :link
finder = by_page

puts "\nbroken_link_finder v#{BrokenLinkFinder::VERSION}"

binding.pry

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
broken_link_finder-0.9.1 bin/console