Class: Yoda::Store::Project
- Inherits:
-
Object
- Object
- Yoda::Store::Project
show all
- Defined in:
- lib/yoda/store/project.rb,
lib/yoda/store/project/cache.rb,
lib/yoda/store/project/library_doc_loader.rb
Defined Under Namespace
Classes: Cache, LibraryDocLoader
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(root_path) ⇒ Project
Returns a new instance of Project.
16
17
18
19
20
|
# File 'lib/yoda/store/project.rb', line 16
def initialize(root_path)
fail ArgumentError, root_path unless root_path.is_a?(String)
@root_path = File.absolute_path(root_path)
end
|
Instance Attribute Details
13
14
15
|
# File 'lib/yoda/store/project.rb', line 13
def registry
@registry
end
|
#root_path ⇒ String
10
11
12
|
# File 'lib/yoda/store/project.rb', line 10
def root_path
@root_path
end
|
Instance Method Details
#build_cache ⇒ Array<BaseError>
35
36
37
38
39
40
41
|
# File 'lib/yoda/store/project.rb', line 35
def build_cache
setup
loader = LibraryDocLoader.build_for(self)
loader.run
load_project_files
loader.errors
end
|
#clear ⇒ Object
Delete all data from registry
29
30
31
32
|
# File 'lib/yoda/store/project.rb', line 29
def clear
setup
registry.clear
end
|
#read_source(source_path) ⇒ Object
53
54
55
|
# File 'lib/yoda/store/project.rb', line 53
def read_source(source_path)
Actions::ReadFile.run(registry, source_path)
end
|
#rebuild_cache ⇒ Object
43
44
45
46
|
# File 'lib/yoda/store/project.rb', line 43
def rebuild_cache
clear
build_cache
end
|
#setup ⇒ Object
22
23
24
25
26
|
# File 'lib/yoda/store/project.rb', line 22
def setup
return if registry
make_dir
@registry = cache.prepare_registry
end
|
#yoda_dir ⇒ Object
48
49
50
|
# File 'lib/yoda/store/project.rb', line 48
def yoda_dir
File.expand_path('.yoda', root_path)
end
|