Module: UqamGradeNotification

Defined in:
lib/uqam_grade_notification.rb,
lib/uqam_grade_notification/client.rb,
lib/uqam_grade_notification/storage.rb,
lib/uqam_grade_notification/student.rb,
lib/uqam_grade_notification/version.rb,
lib/uqam_grade_notification/notifier.rb

Defined Under Namespace

Classes: Client, Notifier, Storage, Student

Constant Summary collapse

APP_DIR =
"#{ENV["HOME"]}/.uqam_grade_notification"
CONFIG_FILE =
"#{APP_DIR}/user.json"
VERSION =
"0.2.1"

Class Method Summary collapse

Class Method Details

.configuration_cliObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# 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")
   = 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_token" => twilio_token,
           "twilio_phone" => twilio_phone
  }

  File.write(CONFIG_FILE, info.to_json)
  info
end

.new(student, notifier, storage = UqamGradeNotification::Storage.new) ⇒ Object



17
18
19
# File 'lib/uqam_grade_notification.rb', line 17

def new(student, notifier, storage=UqamGradeNotification::Storage.new)
  Client.new(student, notifier, storage)
end