Class: Yoda::Server::Session
- Inherits:
-
Object
- Object
- Yoda::Server::Session
- Defined in:
- lib/yoda/server/session.rb
Instance Attribute Summary collapse
- #file_store ⇒ FileStore readonly
- #project ⇒ Store::Project readonly
- #root_uri ⇒ String readonly
Instance Method Summary collapse
-
#initialize(root_uri) ⇒ Session
constructor
A new instance of Session.
- #registry ⇒ Store::Registry
- #reparse_doc(uri) ⇒ Object
- #root_path ⇒ Object
- #setup ⇒ Object
- #uri_of_path(path) ⇒ Object
Constructor Details
Instance Attribute Details
#file_store ⇒ FileStore (readonly)
10 11 12 |
# File 'lib/yoda/server/session.rb', line 10 def file_store @file_store end |
#project ⇒ Store::Project (readonly)
13 14 15 |
# File 'lib/yoda/server/session.rb', line 13 def project @project end |
#root_uri ⇒ String (readonly)
7 8 9 |
# File 'lib/yoda/server/session.rb', line 7 def root_uri @root_uri end |
Instance Method Details
#registry ⇒ Store::Registry
27 28 29 |
# File 'lib/yoda/server/session.rb', line 27 def registry project.registry end |
#reparse_doc(uri) ⇒ Object
44 45 46 47 |
# File 'lib/yoda/server/session.rb', line 44 def reparse_doc(uri) path = FileStore.path_of_uri(uri) project.read_source(path) end |
#root_path ⇒ Object
22 23 24 |
# File 'lib/yoda/server/session.rb', line 22 def root_path @root_path ||= FileStore.path_of_uri(root_uri) end |
#setup ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/yoda/server/session.rb', line 31 def setup unless Store::Actions::BuildCoreIndex.exists? Instrument.instance.initialization_progress(phase: :core, message: 'Downloading and building core index') Store::Actions::BuildCoreIndex.run end project.build_cache end |
#uri_of_path(path) ⇒ Object
40 41 42 |
# File 'lib/yoda/server/session.rb', line 40 def uri_of_path(path) FileStore.uri_of_path(File.(path, root_path)) end |