Method: YARD::Handlers::Processor#process

Defined in:
lib/yard/handlers/processor.rb

#process(statements) ⇒ void

This method returns an undefined value.

Processes a list of statements by finding handlers to process each one.

Parameters:

  • statements (Array)

    a list of statements


124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/yard/handlers/processor.rb', line 124

def process(statements)
  statements.each_with_index do |stmt, index|
    find_handlers(stmt).each do |handler|
      begin
        handler.new(self, stmt).process
      rescue Parser::LoadOrderError => loaderr
        raise # Pass this up
      rescue NamespaceMissingError => missingerr
        log.warn "The #{missingerr.object.type} #{missingerr.object.path} has not yet been recognized."
        log.warn "If this class/method is part of your source tree, this will affect your documentation results."
        log.warn "You can correct this issue by loading the source file for this object before `#{file}'"
        log.warn
      rescue Parser::UndocumentableError => undocerr
        log.warn "in #{handler.to_s}: Undocumentable #{undocerr.message}"
        log.warn "\tin file '#{file}':#{stmt.line}:\n\n" + stmt.show + "\n"
      rescue => e
        log.error "Unhandled exception in #{handler.to_s}:"
        log.error "  in `#{file}`:#{stmt.line}:\n\n#{stmt.show}\n"
        log.backtrace(e)
      end
    end
  end
end