Class: Yard::Lint::Validators::Documentation::UndocumentedObjects::Parser
- Inherits:
-
Parsers::Base
- Object
- Parsers::Base
- Yard::Lint::Validators::Documentation::UndocumentedObjects::Parser
- Defined in:
- lib/yard/lint/validators/documentation/undocumented_objects/parser.rb
Overview
Class used to extract details about undocumented objects from raw yard list output
Constant Summary collapse
- LINE_REGEX =
Regex used to parse yard list output format: file.rb:LINE: ObjectName
/^(.+):(\d+): (.+)$/
Instance Method Summary collapse
-
#call(yard_list_output) ⇒ Array<Hash>
Array with undocumented objects details.
Methods inherited from Parsers::Base
Instance Method Details
#call(yard_list_output) ⇒ Array<Hash>
Returns Array with undocumented objects details.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/yard/lint/validators/documentation/undocumented_objects/parser.rb', line 18 def call(yard_list_output) yard_list_output .split("\n") .map(&:strip) .reject(&:empty?) .filter_map do |line| match = line.match(LINE_REGEX) next unless match { location: match[1], line: match[2].to_i, element: match[3] } end end |