Class: YARD::Server::Commands::LibraryCommand

Inherits:
Base
  • Object
show all
Defined in:
lib/yard/server/commands/library_command.rb

Overview

Since:

Instance Attribute Summary (collapse)

Attributes inherited from Base

#adapter, #body, #caching, #command_options, #headers, #path, #request, #status

Instance Method Summary (collapse)

Methods inherited from Base

#cache, #not_found, #redirect, #render, #run

Constructor Details

- (LibraryCommand) initialize(opts = {})

A new instance of LibraryCommand

Since:

  • 0.6.0



20
21
22
23
# File 'lib/yard/server/commands/library_command.rb', line 20

def initialize(opts = {})
  super
  self.serializer = DocServerSerializer.new(self)
end

Instance Attribute Details

- (Boolean) incremental

Whether to reparse data

Returns:

  • (Boolean)

    whether to reparse data

Since:

  • 0.6.0



18
19
20
# File 'lib/yard/server/commands/library_command.rb', line 18

def incremental
  @incremental
end

- (LibraryVersion) library

The object containing library information

Returns:

Since:

  • 0.6.0



6
7
8
# File 'lib/yard/server/commands/library_command.rb', line 6

def library
  @library
end

- (Hash{Symbol => Object}) options

Default options for the library

Returns:

  • (Hash{Symbol => Object})

    default options for the library

Since:

  • 0.6.0



9
10
11
# File 'lib/yard/server/commands/library_command.rb', line 9

def options
  @options
end

- (Serializers::Base) serializer

The serializer used to perform file linking

Returns:

Since:

  • 0.6.0



12
13
14
# File 'lib/yard/server/commands/library_command.rb', line 12

def serializer
  @serializer
end

- (Boolean) single_library

Whether router should route for multiple libraries

Returns:

  • (Boolean)

    whether router should route for multiple libraries

Since:

  • 0.6.0



15
16
17
# File 'lib/yard/server/commands/library_command.rb', line 15

def single_library
  @single_library
end

Instance Method Details

- (Object) call(request)

Since:

  • 0.6.0



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/yard/server/commands/library_command.rb', line 25

def call(request)
  self.options = SymbolHash.new(false).update(
    :serialize => false,
    :serializer => serializer,
    :library => library,
    :adapter => adapter,
    :single_library => single_library,
    :markup => :rdoc,
    :format => :html
  )
  setup_library
  super
rescue LibraryNotPreparedError
  not_prepared(request)
end