Class: Yard::Lint::Parsers::OneLineBase
- Defined in:
- lib/yard/lint/parsers/one_line_base.rb
Overview
Base class for all one line warnings parsers
Direct Known Subclasses
Validators::Warnings::InvalidDirectiveFormat::Parser, Validators::Warnings::InvalidTagFormat::Parser, Validators::Warnings::UnknownDirective::Parser, Validators::Warnings::UnknownTag::Parser
Instance Method Summary collapse
-
#call(yard_stats) ⇒ Array<Hash>
Array with all warnings informations from yard stats analysis.
Methods inherited from Base
Instance Method Details
#call(yard_stats) ⇒ Array<Hash>
Returns array with all warnings informations from yard stats analysis.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/yard/lint/parsers/one_line_base.rb', line 10 def call(yard_stats) # Not all the lines from the yard_stats output are valuable, that's why we filter # them out, preprocess and leave only those against which we should match rows = classify(yard_stats.split("\n")) rows.map do |warning| { name: self.class.to_s.split('::').last, message: match(warning, :message).last, location: match(warning, :location).last, line: match(warning, :line).last.to_i } end end |