Module: Rsssf

Defined in:
lib/rsssf/page.rb,
lib/rsssf/utils.rb,
lib/rsssf/project.rb,
lib/rsssf/version.rb,
lib/rsssf/download.rb,
lib/rsssf/schedule.rb,
lib/rsssf/page-meta.rb,
lib/rsssf/fmtfix/dates.rb,
lib/rsssf/fmtfix/goals.rb,
lib/rsssf/fmtfix/score.rb,
lib/rsssf/reports/page.rb,
lib/rsssf/fmtfix/errata.rb,
lib/rsssf/fmtfix/fmtfix.rb,
lib/rsssf/fmtfix/rounds.rb,
lib/rsssf/fmtfix/tables.rb,
lib/rsssf/convert/errata.rb,
lib/rsssf/fmtfix/headers.rb,
lib/rsssf/fmtfix/outline.rb,
lib/rsssf/convert/convert.rb,
lib/rsssf/prepare/convert.rb,
lib/rsssf/prepare/download.rb,
lib/rsssf/reports/schedule.rb,
lib/rsssf/fmtfix/topscorers.rb,
lib/rsssf/fmtfix/fmtfix-base.rb,
lib/rsssf/page-find_schedule.rb,
lib/rsssf/convert/html_to_txt.rb,
lib/rsssf/fmtfix/dates_helpers.rb,
lib/rsssf/prepare/convert-meta.rb,
lib/rsssf/convert/html_entities.rb,
lib/rsssf/fmtfix/patch_headings.rb,
lib/rsssf/prepare/convert-links.rb,
lib/rsssf/prepare/convert-navlines.rb,
lib/rsssf/prepare/convert-postproc.rb,
lib/rsssf/convert/html_to_txt/replace_hr.rb,
lib/rsssf/convert/html_to_txt/remove_emails.rb,
lib/rsssf/convert/html_to_txt/replace_a_href.rb,
lib/rsssf/convert/html_to_txt/replace_a_name.rb,
lib/rsssf/convert/html_to_txt/replace_heading.rb,
lib/rsssf/convert/html_to_txt/beautify_anchors.rb

Defined Under Namespace

Modules: Utils Classes: Fmtfix, Page, PageConverter, PageReport, PageStat, Prep, Project, Schedule, ScheduleReport, ScheduleStat

Constant Summary collapse

MAJOR =
0
MINOR =
3
PATCH =
0
VERSION =
[MAJOR,MINOR,PATCH].join('.')

Class Method Summary collapse

Class Method Details



13
14
15
# File 'lib/rsssf/version.rb', line 13

def self.banner
  "rsssf/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}] in (#{root})"
end

.config_dirObject



21
22
23
# File 'lib/rsssf/version.rb', line 21

def self.config_dir
  "#{root}/config"
end

.download_page(url, encoding:) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/rsssf/download.rb', line 4

def self.download_page( url, encoding: )

  ## note: assume plain 7-bit ascii for now
  ##  -- assume rsssf uses ISO_8859_15 (updated version of ISO_8859_1)
  ###-- does NOT use utf-8 character encoding!!!
  response = Webget.page( url, encoding: encoding )  ## fetch (and cache) html page (via HTTP GET)

  ## note: exit on get / fetch error - do NOT continue for now - why? why not?
  exit 1   if response.status.nok?    ## e.g.  HTTP status code != 200


  puts "html:"
  html =  response.text( encoding: encoding )
  pp html[0..400]
  html
end

.rootObject



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

def self.root
   File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )
end

.versionObject



9
10
11
# File 'lib/rsssf/version.rb', line 9

def self.version
  VERSION
end