File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
1
module DirectoryParser
2
+ def fetch_all_dirs ( root_dir )
3
+ Find . find ( root_dir ) . select { |e | File . directory? ( e ) }
4
+ end
5
+
2
6
def glob_files ( path , extensions )
3
7
path = File . join ( path , File ::SEPARATOR ) + '*' + extensions
4
8
Dir . glob ( path ) . select { |entry | File . file? ( entry ) } . compact
Original file line number Diff line number Diff line change 2
2
3
3
require 'find'
4
4
5
+ require_relative 'directory_parser'
5
6
require_relative 'include_to_component_resolver'
6
7
require_relative 'source_component'
7
8
8
9
# Parses all components of a project
9
10
class Project
11
+ include DirectoryParser
12
+
10
13
def initialize ( path )
11
14
@path = path
12
15
@include_resolver = IncludeToComponentResolver . new ( source_components )
@@ -54,7 +57,4 @@ def build_source_components
54
57
components . delete_if { |_ , v | v . source_files . size . zero? }
55
58
end
56
59
57
- def fetch_all_dirs ( source_dir )
58
- Find . find ( source_dir ) . select { |e | File . directory? ( e ) }
59
- end
60
60
end
You can’t perform that action at this time.
0 commit comments