Class: Reconn::ProjectScanner
- Inherits:
-
Object
- Object
- Reconn::ProjectScanner
- Defined in:
- lib/reconn/util/project_scanner.rb
Class Method Summary collapse
-
.scan(proj_path) ⇒ Array<String>
Scans the given directory and all its subdirectories for ruby files.
Class Method Details
.scan(proj_path) ⇒ Array<String>
Scans the given directory and all its subdirectories for ruby files
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/reconn/util/project_scanner.rb', line 10 def self.scan(proj_path) paths = [] begin Find.find(proj_path) do |path| if FileTest.directory?(path) if File.basename(path)[0] == '.' Find.prune end end if File.extname(path) == '.rb' paths << path end end rescue raise InvalidPathException, "Can't open the directory" end paths end |