Class: Blufin::ScannerJs

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

Constant Summary collapse

DATA_TYPES =
%w(string number boolean array object *)

Class Method Summary collapse

Class Method Details

.scan(path) ⇒ Object

Scan Javascript code.

Returns:

  • void



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/scan/scanner_js.rb', line 9

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)

    @path   = 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