Class: Blufin::ScannerJsTests

Inherits:
Object
  • Object
show all
Defined in:
lib/scan/scanner_js_tests.rb

Class Method Summary collapse

Class Method Details

.scan(path) ⇒ Object

Scan Javascript (test) code.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/scan/scanner_js_tests.rb', line 7

def self.scan(path)

    # Check path exists.
    Blufin::Terminal::error("Path does not exist: #{Blufin::Terminal::format_invalid(path)}") unless Blufin::Files::path_exists(path)

    @data   = {}
    @errors = []

    # Get all file(s) in path.
    Blufin::Files::get_files_in_dir(path, 'js').each { |file| scan_file(file) }

    return @data, @errors

end