Class: JsDependency::SourceAnalysis::Orphan
- Inherits:
-
Object
- Object
- JsDependency::SourceAnalysis::Orphan
- Defined in:
- lib/js_dependency/source_analysis/orphan.rb
Overview
Components is not depended on.
Instance Method Summary collapse
- #call ⇒ Array<String>
-
#initialize(index, src_path) ⇒ Orphan
constructor
A new instance of Orphan.
Constructor Details
#initialize(index, src_path) ⇒ Orphan
Returns a new instance of Orphan.
11 12 13 14 |
# File 'lib/js_dependency/source_analysis/orphan.rb', line 11 def initialize(index, src_path) @index = index @src_path = src_path end |
Instance Method Details
#call ⇒ Array<String>
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/js_dependency/source_analysis/orphan.rb', line 17 def call orphan_index = @index.filter do |target_path, _child_paths| orphan?(target_path) end orphan_index = orphan_index.transform_keys do |target_path| relative_path_or_external_path(target_path, @src_path) end orphan_index.keys.uniq.sort end |