Module: GitCheckCI::Formatter

Extended by:
Formatter
Included in:
Formatter
Defined in:
lib/git-check-ci/formatter.rb

Instance Method Summary collapse

Instance Method Details

#handle_response(data) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/git-check-ci/formatter.rb', line 7

def handle_response(data)
  case data[:body]
    when /failed/              then [ color_code(:red),    '' ]
    when /(pending|building)/  then [ color_code(:gray),   '' ]
    when /[0-9a-f]{40}/        then [ color_code(:green),  '' ]
    else [ color_code(:yellow), '!' ]
  end
end