Module: Wgit

Defined in:
lib/wgit/version.rb,
lib/wgit/dsl.rb,
lib/wgit/url.rb,
lib/wgit/base.rb,
lib/wgit/model.rb,
lib/wgit/utils.rb,
lib/wgit/logger.rb,
lib/wgit/crawler.rb,
lib/wgit/indexer.rb,
lib/wgit/document.rb,
lib/wgit/response.rb,
lib/wgit/assertable.rb,
lib/wgit/html_to_text.rb,
lib/wgit/robots_parser.rb,
lib/wgit/database/database.rb

Overview

Wgit is a WWW indexer/scraper which crawls URL's and retrieves their page contents for later use.

Author:

  • Michael Telford

Defined Under Namespace

Modules: Assertable, DSL, Database, Model, Utils Classes: Base, Crawler, Document, HTMLToText, Indexer, Response, RobotsParser, Url

Constant Summary collapse

VERSION =

The current gem version of Wgit.

"0.12.0"

Class Method Summary collapse

Class Method Details

.default_loggerLogger

Returns the default Logger instance.

Returns:

  • (Logger)

    The default Logger instance.



30
31
32
33
34
35
36
# File 'lib/wgit/logger.rb', line 30

def self.default_logger
  logger = Logger.new($stdout, progname: "wgit", level: :info)
  logger.formatter = proc do |_severity, _datetime, progname, msg|
    "[#{progname}] #{msg}\n"
  end
  logger
end

.loggerLogger

Returns the current Logger instance.

Returns:

  • (Logger)

    The current Logger instance.



15
16
17
# File 'lib/wgit/logger.rb', line 15

def self.logger
  @logger
end

.logger=(logger) ⇒ Logger

Sets the current Logger instance.

Parameters:

  • logger (Logger)

    The Logger instance to use.

Returns:

  • (Logger)

    The current Logger instance having being set.



23
24
25
# File 'lib/wgit/logger.rb', line 23

def self.logger=(logger)
  @logger = logger
end

.use_default_loggerLogger

Sets the default Logger instance to be used by Wgit.

Returns:

  • (Logger)

    The default Logger instance.



41
42
43
# File 'lib/wgit/logger.rb', line 41

def self.use_default_logger
  @logger = default_logger
end

.versionObject

Returns the current gem version of Wgit as a String.



12
13
14
# File 'lib/wgit/version.rb', line 12

def self.version
  VERSION
end

.version_strObject

Returns the current gem version in a presentation String.



17
18
19
# File 'lib/wgit/version.rb', line 17

def self.version_str
  "wgit v#{VERSION}"
end