Class: Expressir::Commands::Coverage

Inherits:
Base
  • Object
show all
Defined in:
lib/expressir/commands/coverage.rb

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#exit_with_error, #initialize, #say

Constructor Details

This class inherits a constructor from Expressir::Commands::Base

Instance Method Details

#run(paths) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/expressir/commands/coverage.rb', line 9

def run(paths)
  if paths.empty?
    exit_with_error "No paths specified. Please provide paths to EXPRESS files or directories."
  end

  reports = collect_reports(paths)

  if reports.empty?
    exit_with_error "No valid EXPRESS files were processed. Nothing to report."
  end

  # Generate output based on format
  case options[:format].downcase
  when "json"
    display_json_output(reports)
  when "yaml"
    display_yaml_output(reports)
  else # Default to text
    display_text_output(reports)
  end
end