Class: DeltaTest::CLI::StatsShowCommand
Constant Summary
Constants inherited
from CommandBase
CommandBase::DEFAULT_OPTIONS
Instance Method Summary
collapse
Methods inherited from CommandBase
#bundler_enabled?, #create_error_file, #current_process_status_success?, #error_file, #error_recorded?, #exec_with_data, #exit_with_message, #hook_create_error_file, #initialize, #invoke, #parse_options!, #record_error
Instance Method Details
#invoke! ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/delta_test/cli/stats_show_command.rb', line 9
def invoke!
if stats.base_commit
puts 'Base commit: %s' % [stats.base_commit]
puts
else
raise StatsNotFoundError
end
list.load_table!(stats.table_file_path)
print_table
end
|
#list ⇒ Object
25
26
27
|
# File 'lib/delta_test/cli/stats_show_command.rb', line 25
def list
@list ||= RelatedSpecList.new
end
|
#print_table ⇒ Object
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/delta_test/cli/stats_show_command.rb', line 29
def print_table
if list.table.any?
list.table.each do |spec_file, dependencies|
puts spec_file
puts
dependencies.each do |dependency|
puts "\t#{dependency}"
end
puts
end
else
puts '(no entry)'
end
end
|
#stats ⇒ Object
21
22
23
|
# File 'lib/delta_test/cli/stats_show_command.rb', line 21
def stats
@stats ||= Stats.new
end
|