Class: Psychic::Runner::CLI::List

Inherits:
RunnerCLI show all
Defined in:
lib/psychic/runner/cli.rb

Constant Summary

Constants inherited from CLI

CLI::BUILT_IN_TASKS

Instance Method Summary collapse

Methods inherited from CLI

start

Instance Method Details

#samplesObject



69
70
71
72
73
74
# File 'lib/psychic/runner/cli.rb', line 69

def samples
  samples = runner.known_samples.map do |sample|
    [set_color(sample.name, :bold), sample.source_file]
  end
  print_table samples
end

#tasksObject



79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/psychic/runner/cli.rb', line 79

def tasks
  runner.known_tasks.map do |task|
    task_id = set_color(task, :bold)
    if options[:verbose]
      details = runner.task_for(task)
      details = details.call if details.respond_to? :call
      details = "\n#{details}".lines.join('  ') if details.lines.size > 1
      say "#{task_id}: #{details}"
    else
      say task_id
    end
  end
end