Class: Txray::Reporters::Text
- Inherits:
-
Object
- Object
- Txray::Reporters::Text
- Defined in:
- lib/txray/reporters/text.rb
Constant Summary collapse
- COLORS =
{ high: 91, medium: 93, low: 96 }.freeze
Instance Method Summary collapse
-
#initialize(io: $stdout, color: Reporters.color?(io)) ⇒ Text
constructor
A new instance of Text.
- #report(result) ⇒ Object
Constructor Details
Instance Method Details
#report(result) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/txray/reporters/text.rb', line 16 def report(result) result.offenses.group_by(&:path).each_with_index do |(path, offenses), index| @io.puts if index.positive? heading(path, offenses) offenses.each_with_index do |offense, position| @io.puts if position.positive? offense_body(offense) end end @io.puts summary(result) end |