Class: YARD::Server::Commands::LibraryCommand Abstract
- Defined in:
- lib/yard/server/commands/library_command.rb
Overview
This is the base command for all commands that deal directly with libraries. Some commands do not, but most (like DisplayObjectCommand) do. If your command deals with libraries directly, subclass this class instead. See Base for notes on how to subclass a command.
Direct Known Subclasses
DisplayFileCommand, DisplayObjectCommand, ListCommand, SearchCommand, StaticFileCommand
Constant Summary collapse
- @@library_chdir_lock =
Needed to synchronize threads in #setup_yardopts
Mutex.new
Instance Attribute Summary collapse
-
#incremental ⇒ Boolean
Whether to reparse data.
-
#library ⇒ LibraryVersion
The object containing library information.
-
#options ⇒ LibraryOptions
Default options for the library.
-
#serializer ⇒ Serializers::Base
The serializer used to perform file linking.
-
#single_library ⇒ Boolean
Whether router should route for multiple libraries.
-
#use_fork ⇒ Boolean
Whether or not this adapter calls
fork
when serving library requests.
Attributes inherited from Base
#adapter, #body, #caching, #command_options, #headers, #path, #request, #status
Instance Method Summary collapse
- #call(request) ⇒ Object
-
#initialize(opts = {}) ⇒ LibraryCommand
constructor
A new instance of LibraryCommand.
Methods inherited from Base
Constructor Details
#initialize(opts = {}) ⇒ LibraryCommand
Returns a new instance of LibraryCommand.
63 64 65 66 |
# File 'lib/yard/server/commands/library_command.rb', line 63 def initialize(opts = {}) super self.serializer = DocServerSerializer.new end |
Instance Attribute Details
#incremental ⇒ Boolean
Returns whether to reparse data.
53 54 55 |
# File 'lib/yard/server/commands/library_command.rb', line 53 def incremental @incremental end |
#library ⇒ LibraryVersion
Returns the object containing library information.
41 42 43 |
# File 'lib/yard/server/commands/library_command.rb', line 41 def library @library end |
#options ⇒ LibraryOptions
Returns default options for the library.
44 45 46 |
# File 'lib/yard/server/commands/library_command.rb', line 44 def @options end |
#serializer ⇒ Serializers::Base
Returns the serializer used to perform file linking.
47 48 49 |
# File 'lib/yard/server/commands/library_command.rb', line 47 def serializer @serializer end |
#single_library ⇒ Boolean
Returns whether router should route for multiple libraries.
50 51 52 |
# File 'lib/yard/server/commands/library_command.rb', line 50 def single_library @single_library end |
#use_fork ⇒ Boolean
Returns whether or not this adapter calls fork
when serving library requests. Defaults to false.
57 58 59 |
# File 'lib/yard/server/commands/library_command.rb', line 57 def use_fork @use_fork end |
Instance Method Details
#call(request) ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/yard/server/commands/library_command.rb', line 68 def call(request) if can_fork? call_with_fork(request) { super } else begin save_default_template_info call_without_fork(request) { super } ensure restore_template_info end end end |