Class: Swiftrail::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/swiftrail/cli.rb

Instance Method Summary collapse

Instance Method Details

#coverageObject



36
37
38
39
40
41
42
43
44
# File 'lib/swiftrail/cli.rb', line 36

def coverage
  results = swiftrail_coverage.coverage_report(options[:run_id])
  if options['output_folder'].nil?
    puts(JSON.pretty_generate(results))
  else
    write(results, File.join(options['output_folder'], 'coverage.swiftrail'))
  end

end

#lintObject



48
49
50
51
52
53
54
55
# File 'lib/swiftrail/cli.rb', line 48

def lint
  results = swiftrail_lint.lint_report(options[:run_id])
  if options['output_folder'].nil?
    puts(JSON.pretty_generate(results))
  else
    write(results, File.join(options['output_folder'], 'lint.swiftrail'))
  end
end

#reportObject



26
27
28
29
30
31
32
# File 'lib/swiftrail/cli.rb', line 26

def report
  if swiftrail_reporter.report_results(options[:run_id], options[:dry_run])
    puts 'Successfully reported the results'
  else
    puts 'There was an issue while reporting the results'
  end
end