Class: CC::Formatters::PlainFormatter

Inherits:
Service::Formatter show all
Defined in:
lib/cc/formatters/plain_formatter.rb

Instance Attribute Summary

Attributes inherited from Service::Formatter

#options

Instance Method Summary collapse

Methods inherited from Service::Formatter

#initialize

Constructor Details

This class inherits a constructor from CC::Service::Formatter

Instance Method Details

#format_coverageObject



9
10
11
12
13
14
# File 'lib/cc/formatters/plain_formatter.rb', line 9

def format_coverage
  message = message_prefix
  message << "#{emoji} Test coverage has #{changed}"
  message << " to #{covered_percent}% (#{delta})."
  message << " (#{details_url})"
end

#format_qualityObject



16
17
18
19
20
21
# File 'lib/cc/formatters/plain_formatter.rb', line 16

def format_quality
  message = message_prefix
  message << "#{emoji} #{constant_name} has #{changed}"
  message << " from #{previous_rating} to #{rating}."
  message << " (#{details_url})"
end

#format_testObject



4
5
6
7
# File 'lib/cc/formatters/plain_formatter.rb', line 4

def format_test
  message = message_prefix
  message << "This is a test of the #{service_title} service hook"
end

#format_vulnerabilityObject



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/cc/formatters/plain_formatter.rb', line 23

def format_vulnerability
  message = message_prefix

  if multiple?
    message << "#{vulnerabilities.size} new #{warning_type} issues found"
  else
    message << "New #{warning_type} issue found" << location_info
  end

  message << ". Details: #{details_url}"
end