Sha256: 3cec2241492ed7b2bab79c587cadb8c08e7ce2575aa54d7ecf0ced35dc276b46

Contents?: true

Size: 1.02 KB

Versions: 4

Compression:

Stored size: 1.02 KB

Contents

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

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

# Monkey patch and log all HTTP requests made during the console.
module Typhoeus
  singleton_class.class_eval do
    alias_method :orig_get, :get
  end

  def self.get(base_url, options = {})
    puts "[typhoeus] Sending GET: #{base_url}"
    resp = orig_get(base_url, options)
    puts "[typhoeus] Status: #{resp.code} (#{resp.body.length} bytes in #{resp.total_time} seconds)"
    resp
  end
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

# Start the console.
puts "\nbroken_link_finder v#{BrokenLinkFinder::VERSION}"

binding.pry

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
broken_link_finder-0.9.5 bin/console
broken_link_finder-0.9.4 bin/console
broken_link_finder-0.9.3 bin/console
broken_link_finder-0.9.2 bin/console