Class: PreCommit::Message::Extractor
- Inherits:
-
Object
- Object
- PreCommit::Message::Extractor
- Defined in:
- lib/plugins/pre_commit/message/extractor.rb
Overview
Responsible for extract error messages from terminal output
Instance Method Summary collapse
-
#extract(terminal_output) ⇒ Domain::Checkstyle
Extract data from a XML formatted
terminal_output
.
Instance Method Details
#extract(terminal_output) ⇒ Domain::Checkstyle
Extract data from a XML formatted terminal_output
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/plugins/pre_commit/message/extractor.rb', line 17 def extract(terminal_output) if blank?(terminal_output) || blank?(xml_content_of(terminal_output)) return Domain::Checkstyle.good end xml_data = Crack::XML.parse(xml_content_of(terminal_output)) files = xml_data['checkstyle']['file'] Domain::Checkstyle.new(extract_bad_file(files)) end |