class Yoda::Server::Session

Attributes

file_store[R]

@return [FileStore]

project[R]

@return [Store::Project]

root_uri[R]

@return [String]

Public Class Methods

new(root_uri) click to toggle source

@param root_uri [String] an uri expression of project root path

# File lib/yoda/server/session.rb, line 16
def initialize(root_uri)
  @root_uri = root_uri
  @file_store = FileStore.new
  @project = Store::Project.new(root_path)
end

Public Instance Methods

registry() click to toggle source

@return [Store::Registry]

# File lib/yoda/server/session.rb, line 27
def registry
  project.registry
end
reparse_doc(uri) click to toggle source
# 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() click to toggle source
# File lib/yoda/server/session.rb, line 22
def root_path
  @root_path ||= FileStore.path_of_uri(root_uri)
end
setup() click to toggle source
# 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) click to toggle source

@param path [String]

# File lib/yoda/server/session.rb, line 40
def uri_of_path(path)
  FileStore.uri_of_path(File.expand_path(path, root_path))
end