module RCrawler

Constants

VERSION

Public Class Methods

async(&block) click to toggle source
# File lib/rcrawler.rb, line 38
def async(&block)
  async_threads = Async.new
  async_threads.instance_eval &block
  async_threads.execute
end
configure(&block) click to toggle source
# File lib/rcrawler.rb, line 30
def configure(&block)
  if block_given?
    @config.configure &block
  else
    @config
  end
end
crawl(&block) click to toggle source
# File lib/rcrawler.rb, line 22
def crawl(&block)
  begin
    Timeout::timeout(@config.timeout) {Crawl.new.instance_eval &block}
  rescue Timeout::Error => e
    raise if @config.timeout_proc == :raise
  end
end