class GradesFirst::Config

Public Class Methods

load_paths() click to toggle source
# File lib/gradesfirst/config.rb, line 20
def self.load_paths
  @@load_paths ||= [".env.gf", "#{Dir.home}/.env.gf", ".env.gf.master"]
end
load_paths=(paths) click to toggle source
# File lib/gradesfirst/config.rb, line 24
def self.load_paths=(paths)
  @@load_paths = paths
end
new() click to toggle source
# File lib/gradesfirst/config.rb, line 5
    def initialize
      if GradesFirst::Config.load_paths.any?{ |f| File.exist?(f) }
        Dotenv.load(*GradesFirst::Config.load_paths)
      else
        puts <<-MESSAGE
The configuration file is missing and should be found in one of the
following locations:

#{GradesFirst::Config.load_paths.join('\n')}

See "gf help <command>" for details on configuration settings.
        MESSAGE
      end
    end

Public Instance Methods

code_talkers() click to toggle source
# File lib/gradesfirst/config.rb, line 28
def code_talkers
  ENV["GF_CODE_TALKERS"].to_s.split("|")
end
day_zero() click to toggle source
# File lib/gradesfirst/config.rb, line 32
def day_zero
  if ENV["GF_DAY_ZERO"].nil?
    Time.now
  else
    Time.parse(ENV["GF_DAY_ZERO"])
  end
end
developers() click to toggle source
# File lib/gradesfirst/config.rb, line 40
def developers
  ENV["GF_DEVELOPERS"].to_s.split("|")
end