require "env_checker/version" require "yaml" module EnvChecker def self.check(file = nil) missing_variables = [] variables(file).each do |env_v| missing_variables << "#{env_v[:name]} #{env_v[:desc]}" if ENV[env_v[:name]].nil? end send_error(missing_variables) if missing_variables.any? end private def self.send_error(missing_variables) # Do nothing, override this to send to anywhere you want end def self.variables(file) file ||= "lib/constants/env_variables.yml" YAML.load_file(file) || [] end end