Class: Coursemology::Evaluator::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/coursemology/evaluator/cli.rb

Defined Under Namespace

Classes: Options

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.start(argv) ⇒ Object



8
9
10
# File 'lib/coursemology/evaluator/cli.rb', line 8

def self.start(argv)
  new.start(argv)
end

Instance Method Details

#run(argv) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/coursemology/evaluator/cli.rb', line 16

def run(argv)
  options = optparse!(argv)
  Coursemology::Evaluator.config.poll_interval =
    ::ISO8601::Duration.new("PT#{options.poll_interval}".upcase).to_seconds

  # Must include the time designator T if hours/minutes/seconds are required.
  Coursemology::Evaluator.config.image_lifetime =
    ::ISO8601::Duration.new("P#{options.image_lifetime}".upcase).to_seconds

  Coursemology::Evaluator::Client.initialize(options.host, options.api_user_email,
                                             options.api_token)
  Coursemology::Evaluator::Client.new(options.one_shot).run
end

#start(argv) ⇒ Object



12
13
14
# File 'lib/coursemology/evaluator/cli.rb', line 12

def start(argv)
  run(argv)
end