Class: PreCommit::Message::Extractor

Inherits:
Object
  • Object
show all
Defined in:
lib/plugins/pre_commit/message/extractor.rb

Overview

Responsible for extract error messages from terminal output

Constant Summary collapse

EMPTY =
{ 'checkstyle' => { 'file' => [] } }

Instance Method Summary collapse

Instance Method Details

#extract(output) ⇒ Hash

Extract data from a XML formatted output

Parameters:

  • output (String)

    Xml formatted ouput

Returns:

  • (Hash)


15
16
17
18
# File 'lib/plugins/pre_commit/message/extractor.rb', line 15

def extract(output)
  return EMPTY if output.nil? || output.empty?
  Crack::XML.parse(xml_content(output))
end