Method: YARD::Server::Commands::SearchCommand#run

Defined in:
lib/yard/server/commands/search_command.rb

#runObject

Since:

  • 0.6.0

[View source]

13
14
15
16
17
18
19
20
21
22
# File 'lib/yard/server/commands/search_command.rb', line 13

def run
  Registry.load_all
  self.query = request.query['q']
  redirect("/#{adapter.router.docs_prefix}/#{single_library ? library : ''}") if query.nil? || query =~ /\A\s*\Z/
  if found = Registry.at(query)
    redirect(url_for(found))
  end
  search_for_object
  request.xhr? ? serve_xhr : serve_normal
end