Sha256: bf94647f01b5ed1a92ca153b828d9fb338dd121202ffdb64a5de3b74cb2d51dd

Contents?: true

Size: 446 Bytes

Versions: 1

Compression:

Stored size: 446 Bytes

Contents

require "rubyul/version"

require 'date'
require 'json'

module Rubyul

  def self.academic_year(date)
    (Date.parse(date) << 8).year
  end

  PLATFORM_REGEXES = JSON.parse(File.read(File.dirname(__FILE__) + "/platform_regexes.json"))

  def self.hostname_to_platform(hostname)
    PLATFORM_REGEXES.each do |regexp, platform_name|
      if Regexp.new(regexp) =~ hostname
        return platform_name
      end
    end
    return nil
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubyul-0.5.1 lib/rubyul.rb