module Rubyul

All the small helper functions are here.

Constants

IGNORABLE_REGEXES
PLATFORM_REGEXES
VERSION

Public Class Methods

academic_year(date) click to toggle source
# File lib/rubyul.rb, line 8
def self.academic_year(date)
  # Academic years go from September to August.
  (Date.parse(date) << 8).year
end
hostname_to_platform(hostname, ignore: FALSE) click to toggle source
# File lib/rubyul.rb, line 20
def self.hostname_to_platform(hostname, ignore: FALSE)
  # TODO: Deal with ignores or not, with an option.
  if ignore == TRUE
    return "ignore" if $ignorable_pattern_match =~ hostname
  end
  PLATFORM_REGEXES.each do |regexp, platform_name|
    return platform_name if Regexp.new(regexp) =~ hostname
  end
  nil
end