Method: YARD::Server::LibraryVersion#prepare!

Defined in:
lib/yard/server/library_version.rb

#prepare!Object

Note:

You should not directly override this method. Instead, implement load_yardoc_from_SOURCENAME when implementing loading for a specific source type. See the YARD::Server::LibraryVersion documentation for “Implementing a Custom Library Source”

Prepares a library to be displayed by the server. This callback is performed before each request on a library to ensure that it is loaded and ready to be viewed. If any steps need to be performed prior to loading, they are performed through this method (though they should be implemented through the load_yardoc_from_SOURCE method).

Raises:

  • (LibraryNotPreparedError)

    if the library is not ready to be displayed. Usually when raising this error, you would simultaneously begin preparing the library for subsequent requests, although this is not necessary.

Since:

  • 0.6.0



182
183
184
185
186
# File 'lib/yard/server/library_version.rb', line 182

def prepare!
  return if ready?
  meth = "load_yardoc_from_#{source}"
  send(meth) if respond_to?(meth, true)
end