Class: YARD::Server::Adapter
- Inherits:
-
Object
- Object
- YARD::Server::Adapter
show all
- Defined in:
- lib/yard/server/adapter.rb
Overview
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(libs, opts = {}, server_opts = {}) ⇒ Adapter
Returns a new instance of Adapter.
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/yard/server/adapter.rb', line 28
def initialize(libs, opts = {}, server_opts = {})
self.class.setup
self.libraries = libs
self.options = opts
self.server_options = server_opts
self.document_root = server_options[:DocumentRoot]
self.router = (options[:router] || Router).new(self)
options[:adapter] = self
log.debug "Serving libraries using #{self.class}: #{libraries.keys.join(', ')}"
log.debug "Caching on" if options[:caching]
log.debug "Document root: #{document_root}" if document_root
end
|
Instance Attribute Details
#document_root ⇒ String
Returns the location where static files are located, if any.
8
9
10
|
# File 'lib/yard/server/adapter.rb', line 8
def document_root
@document_root
end
|
#libraries ⇒ Object
10
11
12
|
# File 'lib/yard/server/adapter.rb', line 10
def libraries
@libraries
end
|
#options ⇒ Object
12
13
14
|
# File 'lib/yard/server/adapter.rb', line 12
def options
@options
end
|
#router ⇒ Object
16
17
18
|
# File 'lib/yard/server/adapter.rb', line 16
def router
@router
end
|
#server_options ⇒ Object
14
15
16
|
# File 'lib/yard/server/adapter.rb', line 14
def server_options
@server_options
end
|
Instance Method Details
#add_library(library) ⇒ Object
41
42
43
44
|
# File 'lib/yard/server/adapter.rb', line 41
def add_library(library)
libraries[library.name] ||= []
libraries[library.name] |= [library]
end
|
#start ⇒ Object
46
47
48
|
# File 'lib/yard/server/adapter.rb', line 46
def start
raise NotImplementedError
end
|