Class: Jtest::Commands::Update

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/jtest/commands/update.rb

Instance Method Summary collapse

Instance Method Details

#select_problemsObject



14
15
16
# File 'lib/jtest/commands/update.rb', line 14

def select_problems
  @problems = Problem.select(ids, options)
end

#update_problemsObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/jtest/commands/update.rb', line 18

def update_problems
  @problems.each do |problem|
    say_status :connecting, "Getting info about problem #{problem.id}..."
    problem.retrieve_info

    unless problem.exists?
      say_status :not_found, problem.id, :red
      next
    end

    say_status :found, problem.title, :green

    create_samples(problem)
  end
end