module UqamGradeNotification

Constants

APP_DIR
CONFIG_FILE
VERSION

Public Class Methods

configuration_cli() click to toggle source
# File lib/uqam_grade_notification.rb, line 21
def configuration_cli
  unless Dir.exists?(APP_DIR)
    p "Running first time setup."
    Dir.mkdir(APP_DIR)
  end

  cli = HighLine.new
  code = cli.ask("Code Permanent")
  password = cli.ask("NIP")
  phone = cli.ask("Phone Number")
  twilio_account_id = cli.ask("Twilio Account ID")
  twilio_token = cli.ask("Twilio Token")
  twilio_phone = cli.ask("Twilio Phone Number")

  info = { "code" => code,
           "password" => password,
           "phone" => phone,
           "twilio_account_id" => twilio_account_id,
           "twilio_token" => twilio_token,
           "twilio_phone" => twilio_phone
  }

  File.write(CONFIG_FILE, info.to_json)
  info
end
new(student, notifier, storage=UqamGradeNotification::Storage.new) click to toggle source
# File lib/uqam_grade_notification.rb, line 17
def new(student, notifier, storage=UqamGradeNotification::Storage.new)
  Client.new(student, notifier, storage)
end