Module: Colora::Lines::Diff

Defined in:
lib/colora/plugs/diff.rb

Overview

Diff plugin

Class Method Summary collapse

Class Method Details

.flags(line) ⇒ Object

:reek:TooManyStatements



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/colora/plugs/diff.rb', line 13

def self.flags(line)
  case line[0]
  when '-', '<'
    ldg = line.dig(1, 0)
    ['-', nil].any? { ldg == it } ? '- ' : '< '
  when '+', '>'
    ldg = line.dig(1, 0)
    ['+', nil].any? { ldg == it } ? '+ ' : '> '
  else
    '* '
  end
end

.pad(line) ⇒ Object



26
27
28
# File 'lib/colora/plugs/diff.rb', line 26

def self.pad(line)
  " #{line}"
end