Class: Project
- Inherits:
-
Object
- Object
- Project
- Defined in:
- lib/cpp_dependency_graph/project.rb
Overview
Parses all components of a project
Instance Method Summary collapse
- #dependencies(component) ⇒ Object
- #external_includes(component) ⇒ Object
-
#initialize(path) ⇒ Project
constructor
A new instance of Project.
- #source_component(name) ⇒ Object
- #source_components ⇒ Object
Constructor Details
#initialize(path) ⇒ Project
Returns a new instance of Project.
9 10 11 |
# File 'lib/cpp_dependency_graph/project.rb', line 9 def initialize(path) @path = path end |
Instance Method Details
#dependencies(component) ⇒ Object
21 22 23 |
# File 'lib/cpp_dependency_graph/project.rb', line 21 def dependencies(component) external_includes(component).map { |include| component_for_include(include) }.reject(&:empty?).uniq end |
#external_includes(component) ⇒ Object
25 26 27 |
# File 'lib/cpp_dependency_graph/project.rb', line 25 def external_includes(component) filter_internal_includes(component) end |
#source_component(name) ⇒ Object
17 18 19 |
# File 'lib/cpp_dependency_graph/project.rb', line 17 def source_component(name) source_components.detect { |c| c.name == name } end |
#source_components ⇒ Object
13 14 15 |
# File 'lib/cpp_dependency_graph/project.rb', line 13 def source_components @source_components ||= build_source_components end |