Class: MetzScan::ProjectIndex
- Inherits:
-
Object
- Object
- MetzScan::ProjectIndex
show all
- Defined in:
- lib/metz_scan/project_index.rb,
lib/metz_scan/project_index/null_backend.rb,
lib/metz_scan/project_index/rubydex_backend.rb,
lib/metz_scan/project_index/rubydex_backend/file_discovery.rb,
lib/metz_scan/project_index/rubydex_backend/location_formatting.rb,
lib/metz_scan/project_index/rubydex_backend/method_declarations.rb
Overview
Thin facade over optional project-wide indexes used by future analyzers.
Defined Under Namespace
Classes: Declaration, MethodDeclaration, NullBackend, Reference, RubydexBackend, UnavailableBackendError, UnknownBackendError
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of ProjectIndex.
55
56
57
|
# File 'lib/metz_scan/project_index.rb', line 55
def initialize(backend)
@backend = backend
end
|
Instance Attribute Details
#backend ⇒ Object
Returns the value of attribute backend.
59
60
61
|
# File 'lib/metz_scan/project_index.rb', line 59
def backend
@backend
end
|
Class Method Details
.build(paths, backend: :auto, workspace: false) ⇒ Object
20
21
22
23
24
25
|
# File 'lib/metz_scan/project_index.rb', line 20
def self.build(paths, backend: :auto, workspace: false)
backend = backend.to_sym
raise UnknownBackendError, "unknown project index backend: #{backend}" unless BACKENDS.include?(backend)
new(build_backend(Array(paths), backend, workspace))
end
|
Instance Method Details
#available? ⇒ Boolean
65
66
67
|
# File 'lib/metz_scan/project_index.rb', line 65
def available?
backend.available?
end
|
#backend_name ⇒ Object
61
62
63
|
# File 'lib/metz_scan/project_index.rb', line 61
def backend_name
backend.name
end
|
#constant_references_to(name) ⇒ Object
101
102
103
|
# File 'lib/metz_scan/project_index.rb', line 101
def constant_references_to(name)
backend.constant_references_to(name)
end
|
#declarations ⇒ Object
85
86
87
|
# File 'lib/metz_scan/project_index.rb', line 85
def declarations
backend.declarations
end
|
#descendants_of(name) ⇒ Object
97
98
99
|
# File 'lib/metz_scan/project_index.rb', line 97
def descendants_of(name)
backend.descendants_of(name)
end
|
#diagnostics ⇒ Object
81
82
83
|
# File 'lib/metz_scan/project_index.rb', line 81
def diagnostics
backend.diagnostics
end
|
#documents ⇒ Object
93
94
95
|
# File 'lib/metz_scan/project_index.rb', line 93
def documents
backend.documents
end
|
#index_errors ⇒ Object
77
78
79
|
# File 'lib/metz_scan/project_index.rb', line 77
def index_errors
backend.index_errors
end
|
#indexed_files ⇒ Object
73
74
75
|
# File 'lib/metz_scan/project_index.rb', line 73
def indexed_files
backend.indexed_files
end
|
#method_declarations ⇒ Object
89
90
91
|
# File 'lib/metz_scan/project_index.rb', line 89
def method_declarations
backend.method_declarations
end
|
#reason ⇒ Object
69
70
71
|
# File 'lib/metz_scan/project_index.rb', line 69
def reason
backend.reason
end
|
#search(query) ⇒ Object
105
106
107
|
# File 'lib/metz_scan/project_index.rb', line 105
def search(query)
backend.search(query)
end
|