Class: JobLoader

'brixy.tester.JobLoader'~ JobLoader

new JobLoader (tester, fileFilteropt, folderFilteropt)

JobLoader object.

Extends:
Parameters:
Name Type Attributes Description
tester module:'brixy.tester.Tester'~Tester
fileFilter function <optional>

Callback filters the files in the job folders: function(path){return boolean;}. By default, accepts all files whose name ends with job.jsx / job.jsxinc / job.js. (optional)

folderFilter function <optional>

Callback filters the job folders: function(path){return boolean;}. By default, accepts all folders and subfolders. (optional)

Source:

Extends

Methods

addPath (path)

Adds the include path without applying of the file filter.

Parameters:
Name Type Description
path string
Inherited from:
Source:

alias (alias, path)

Creates alias of the folder path.

Parameters:
Name Type Description
alias string

Folder shortcut.

path string

Folder path relative to the home folder (alias for '') or absolute path.

Throws:
  • Exception if folder doesn't exist.

  • Exception if alias already exists for a different path.

Inherited from:
Source:

aliasPath (alias)

Returns full path of the alias.

Parameters:
Name Type Description
alias string
Throws:
  • Exception if alias doesn't exist.

Inherited from:
Source:

ignore (alias, path)

Stores path to the included list to prevent the further loading. Doesn't test if file exists.

Parameters:
Name Type Description
alias string

Folder shortcut.

path string

File or folder path.

Throws:
  • Exception if alias doesn't exist.

Inherited from:
Source:

isAllowedFile (path) → {boolean}

Filters the file.

Parameters:
Name Type Description
path string

Full path of the file.

Returns:
  • boolean
Overrides:
Source:

isAllowedFolder (path) → {boolean}

Filters the folder. Subclass or instance may define own fileFilter method.

Parameters:
Name Type Description
path string

Full path of the folder.

Returns:
  • boolean
Overrides:
Source:

isLoaded (path)

Tests if the path is already included.

Parameters:
Name Type Description
path string

Full path of the file.

Inherited from:
Source:

load (alias, path)

Includes jsx|jsxinc|js|jsxbin file. Folders are traversed recursively. Each file is included only once.

Parameters:
Name Type Description
alias string

Folder shortcut.

path string

File or folder path.

Throws:
  • Exception if alias or file doesn't exist.

Inherited from:
Source:

loadedPaths () → {Array.<string>}

Return the array of the included file paths.

Returns:
  • Array.<string> :
    • Array of the included file paths.
Inherited from:
Source:

loadFile (file)

Loads the file if it is of an allowed type. Each file is loaded only once.

Parameters:
Name Type Description
file File | Folder

File or folder object.

Throws:
  • Exception if file doesn't exist.

Inherited from:
Source:

onLoadFile (file)

Runs job files.

Parameters:
Name Type Description
file File
Throws:
  • Exception

Overrides:
Source:

onLoadFolder (folder)

Loads files and folders. Folders are traversed recursively. Subclass or instance may define own onLoadFolder method.

Parameters:
Name Type Description
folder Folder
Inherited from:
Source:

toString () → {string}

Returns a string representation of the object.

Returns:
  • string
Inherited from:
Source: