Class: Crosstest::Psychic::CLI::List

Inherits:
BaseCLI
  • Object
show all
Defined in:
lib/crosstest/psychic/cli.rb

Instance Method Summary collapse

Instance Method Details

#scriptsObject


81
82
83
84
85
86
# File 'lib/crosstest/psychic/cli.rb', line 81

def scripts
  scripts = psychic.known_scripts.map do |script|
    [set_color(script.name, :bold), script.source_file]
  end
  print_table scripts
end

#tasksObject

rubocop:disable Metrics/AbcSize


91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/crosstest/psychic/cli.rb', line 91

def tasks # rubocop:disable Metrics/AbcSize
  psychic.known_tasks.map do |task|
    task_id = set_color(task, :bold)
    if options[:verbose]
      details = psychic.task(task)
      details = "\n#{details}".lines.join('  ') if details.lines.size > 1
      say "#{task_id}: #{details}"
    else
      say task_id
    end
  end
end