Module: LameSitemapper

Defined in:
lib/cli.rb,
lib/core.rb,
lib/page.rb,
lib/scraper.rb,
lib/url_helper.rb,
lib/web_helper.rb,
lib/lame_sitemapper.rb,
lib/report_generator.rb,
lib/lame_sitemapper/version.rb

Defined Under Namespace

Classes: Cli, Core, Page, ReportGenerator, Scraper, UrlHelper, WebHelper

Constant Summary collapse

SETTINGS =
begin
  settings_file = File.join(__dir__, "settings.yml")
  env = $PROGRAM_NAME =~ /rspec$/i ? "test" : "production"
  YAML::load(IO.read(settings_file))[env].deep_symbolize_keys
end
LOGGER =
begin
  log_file = SETTINGS[:log][:file_name]
  Logger.new(log_file, SETTINGS[:log][:file_count], SETTINGS[:log][:file_size]).tap do |logger|
    logger.level = SETTINGS[:log_level].to_i
    logger.datetime_format = "%Y-%m-%d %H:%M:%S "
    logger.formatter = proc do |severity, datetime, progname, msg|
      "[#{datetime.strftime('%Y-%m-%d %H:%M:%S')} #{Thread.current[:name]}] #{severity[0]} -- : #{msg}\n"
    end
  end
end
VERSION =
"0.1.0"