Module: Kudzu

Defined in:
lib/kudzu.rb,
lib/kudzu/agent.rb,
lib/kudzu/common.rb,
lib/kudzu/config.rb,
lib/kudzu/crawler.rb,
lib/kudzu/version.rb,
lib/kudzu/callback.rb,
lib/kudzu/model/base.rb,
lib/kudzu/model/link.rb,
lib/kudzu/model/page.rb,
lib/kudzu/thread_pool.rb,
lib/kudzu/agent/robots.rb,
lib/kudzu/agent/fetcher.rb,
lib/kudzu/agent/sleeper.rb,
lib/kudzu/config/filter.rb,
lib/kudzu/agent/response.rb,
lib/kudzu/agent/reference.rb,
lib/kudzu/agent/robots/txt.rb,
lib/kudzu/agent/url_filterer.rb,
lib/kudzu/agent/util/matcher.rb,
lib/kudzu/agent/page_filterer.rb,
lib/kudzu/agent/robots/parser.rb,
lib/kudzu/agent/url_extractor.rb,
lib/kudzu/agent/http/connection.rb,
lib/kudzu/adapter/memory/frontier.rb,
lib/kudzu/agent/util/title_parser.rb,
lib/kudzu/adapter/memory/model/link.rb,
lib/kudzu/adapter/memory/model/page.rb,
lib/kudzu/adapter/memory/repository.rb,
lib/kudzu/agent/http/connection_pool.rb,
lib/kudzu/agent/util/charset_detector.rb,
lib/kudzu/agent/util/mime_type_detector.rb,
lib/kudzu/agent/util/content_type_parser.rb

Defined Under Namespace

Modules: Adapter, Model Classes: Agent, Callback, Common, Config, Crawler, ThreadPool

Constant Summary collapse

VERSION =
'1.2.0'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.adapterObject

Returns the value of attribute adapter


14
15
16
# File 'lib/kudzu.rb', line 14

def adapter
  @adapter
end

.agentObject

Returns the value of attribute agent


14
15
16
# File 'lib/kudzu.rb', line 14

def agent
  @agent
end

.loggerObject

Returns the value of attribute logger


14
15
16
# File 'lib/kudzu.rb', line 14

def logger
  @logger
end

Class Method Details

.log(level, message, error: nil) ⇒ Object


16
17
18
19
20
21
22
# File 'lib/kudzu.rb', line 16

def log(level, message, error: nil)
  return unless @logger
  if error
    message += " - #{error.class}: #{error.message} at #{error.backtrace.take(5).join("\n")}"
  end
  @logger.send(level, message)
end