Class: Yoda::Server::Session
- Inherits:
-
Object
- Object
- Yoda::Server::Session
- Defined in:
- lib/yoda/server/session.rb
Defined Under Namespace
Classes: FileStore
Instance Attribute Summary collapse
-
#client_initialized ⇒ Object
Returns the value of attribute client_initialized.
- #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
#client_initialized ⇒ Object
Returns the value of attribute client_initialized.
15 16 17 |
# File 'lib/yoda/server/session.rb', line 15 def client_initialized @client_initialized end |
#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
30 31 32 |
# File 'lib/yoda/server/session.rb', line 30 def registry project.registry end |
#reparse_doc(uri) ⇒ Object
47 48 49 50 |
# File 'lib/yoda/server/session.rb', line 47 def reparse_doc(uri) path = FileStore.path_of_uri(uri) project.read_source(path) end |
#root_path ⇒ Object
25 26 27 |
# File 'lib/yoda/server/session.rb', line 25 def root_path @root_path ||= FileStore.path_of_uri(root_uri) end |
#setup ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/yoda/server/session.rb', line 34 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
43 44 45 |
# File 'lib/yoda/server/session.rb', line 43 def uri_of_path(path) FileStore.uri_of_path(File.(path, root_path)) end |