Method: LearnLab::CLI#config

Defined in:
lib/learn_lab/cli.rb

#configObject



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/learn_lab/cli.rb', line 35

def config
  configuration = Configuration.open
  email = configuration.email || '<not set>'

  question = "Enter the email you use to log into Canvas\n" \
    "(your current email is '#{email}'):"

  prompt = Prompt.new

  # TODO: What kind of email validation do we want here?
  configuration.email = prompt.ask(question) { |value| !value.empty? }

  configuration.save!
  puts 'Configuration saved!'
end