Task worker modules
- Source:
Namespaces
Methods
-
<static> _basenameWithoutExt(filename) → {string}
-
Get file basename without extension.
Parameters:
Name Type Description filenamestring File name.
Returns:
- Basename without extension.
- Type
- string
-
<static> _convertDirectory(config, callback)
-
Parameters:
Name Type Description configobject Properties
Name Type Description srcDirstring Source jade directory.
ignorestring Ignore jade pattern. Glob.
patternstring Source jade file pattern. Glob.
destDirstring Destination html directory.
fileNameConverterfunction Function to convert file name.
fileContentConverterfunction Function to convert file content.
callbackfunction Callback when done.
-
<static> beautifyJavascriptString(jsString) → {*}
-
Beautify javascript string.
Parameters:
Name Type Description jsStringstring Javascript string to beautify.
Returns:
- Type
- *
-
<static> changeMode(config, callback)
-
Change permissions
Parameters:
Name Type Description configobject Configuration object
Properties
Name Type Description modestring File mode to set.
patternstring File path patterns.
callbackfunction Callback when done.
Example
changeMode({ mode:'444', pattern:'doc/*.html' }, function(err){ console.log('done!'); }); -
<static> cleanDeadSymlinks.(config, callback)
-
Remove symbolic links if it's destination file does not exist.
Parameters:
Name Type Description configobject Configuration object.
Properties
Name Type Argument Default Description basedirstring <optional>
'.' Directory to clean.
callbackfunction Callback when done.
-
<static> cleanDirectory(config, callback)
-
Clean a directory.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Description dirstring Directory to clean. Can be a glob pattern.
callbackfunction Callback when done.
-
<static> compileCoffeeDirectory(config, callback)
-
Compile coffee files in directory.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Description srcDirstring Source coffee directory.
ignorestring Ignore file pattern. Glob.
patternstring Source coffee file pattern. Glob.
destDirstring Destination js directory.
callbackfunction Callback when done.
-
<static> compileJadeDirectory(config, callback)
-
Compile jade files in directory.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Description srcDirstring Source jade directory.
ignorestring Ignore jade pattern. Glob.
minifyboolean Minify file or not.
dataFilestring File name which contains jade render context data.
patternstring Source jade file pattern. Glob.
destDirstring Destination html directory.
callbackfunction Callback when done.
-
<static> compileJadeDirectory(config, callback)
-
Compile jade files.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Description srcDirstring Source jade directory.
ignorestring Ignore jade pattern. Glob.
patternstring Source jade file pattern. Glob.
destDirstring Destination html directory.
callbackfunction Callback when done.
-
<static> compileLessFiles(config, callback)
-
Compile less files.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Description srcDirstring Source jade directory.
ignorestring Ignore jade pattern. Glob.
patternstring Source jade file pattern. Glob.
destDirstring Destination html directory.
callbackfunction Callback when done.
-
<static> concatFiles(config, callback)
-
Concat files.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Argument Description srcstring Filename pattern. Glob.
ignorestring <optional>
Ignore file pattern. Glob.
deststring Destination file name.
callbackfunction Callback when done.
-
<static> execCommand(config, callback)
-
Execute a command.
Parameters:
Name Type Description configobject Task configuration
Properties
Name Type Description commandstring Command.
cwdstring Working directory name.
callbackfunction Callback when done.
-
<static> executeTravisEncrypt(config, callback)
-
Execute travis encrypt command.
Parameters:
Name Type Description configobject Task configuration.
Properties
Name Type Description secretFilestring Secret file.
callbackfunction Callback when done.
-
<static> generateApemanHelperData(config, callback)
-
Generate .apemanhelperdata file.
Parameters:
Name Type Description configobject Task configuration.
Properties
Name Type Description deststring Destination file name.
callbackfunction Callback when done.
-
<static> generateBasenameLinks(config, callback)
-
Generate basename links. No matter how deep target files are, link file name put direct under the destination directory.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Description srcstring Source files with glob patterns.
linkDirstring Directory to create links.
callbackfunction Callback when done.
-
<static> generateClientsideLocaleFiles(config, callback)
-
Generate public locale files.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Description srcDirstring Locale source directory name.
destDirstring Public directory name.
callbackfunction Callback when done.
-
<static> generateColorLess(config, callback)
-
Generate color less.
Parameters:
Name Type Description configobject Task configuration.
Properties
Name Type Description deststring Destination file name.
srcPatternstring Source file name pattern.
callbackfunction Callback when done.
-
<static> generateColorThemesLessFiles(config, callback)
-
Generate api guide document. Using jsdoc.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Description destDirstring Destination directory.
callbackfunction Callback when done.
-
<static> generateConstantsJson(config, callback)
-
Generate path names json file.
Parameters:
Name Type Description configobject Task configuration.
Properties
Name Type Description deststring Destination file name.
datastring Constants data.
callbackfunction Callback when done.
Example
generateConstantsJson({ dest: 'foo/bar/pathnames.json', data: { LOG_DIR_PATH: 'var/log', ACCESS_LOG_PATH: '#{LOG_DIR_PATH}/access.log' } }, function(err){ console.log('done!'); }) -
<static> generateDataJson(config, callback)
-
Generate dot-data json file.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Description srcstring Source file names. Glob.
ignorestring Ignore filename pattern. Glob.
callbackfunction Callback when done.
-
<static> generateDataJson(config, callback)
-
Generate a data json file.
Parameters:
Name Type Description configobject Task configuration
Properties
Name Type Description deststring Destination file name.
dataobject Json data.
callbackfunction Callback when done.
-
<static> generateFontsLessFiles(config, callback)
-
Generate a fonts less file from available font files.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Argument Default Description destDirstring Destination directory.
ignorestring Glob file patterns to ignore.
nameFormatstring <optional>
'%s.less' Less file name format.
fontFilesstring Glob file patterns for font files to collect.
callbackfunction Callback when done.
-
<static> generateHtmlFromMarkdown(config, callback)
-
Generate a html file from markdown.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Description srcstring Source markdown file path.
deststring Destination html file path.
callbackfunction Callback when done.
-
<static> generateIcoImage(config, callback)
-
Generate an icon file from a png file.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Description srcstring Source png file path.
deststring Destination ico file path.
callbackfunction Callback when done.
-
<static> generateIndex(config, callback)
-
Create a index.js for the given directory. Exports files in directory with camelized name.
Parameters:
Name Type Description configobject Configuration object.
Properties
Name Type Argument Default Description dirstring Directory to create index.
capitalizeboolean <optional>
false Exports with capitalize name or not.
patternstring <optional>
'*' Pattern to collect modules within the directory.
deststring <optional>
config.dir+'/index.js' Index file path to generate.
callbackfunction Callback when done.
Example
//This is an index file generate by ci worker. exports.fooBar = require('./foo_bar.js'); -
<static> generateIndexLessFile(config, callback)
-
Generate _index.less files.
Parameters:
Name Type Description configobject Task configuration.
Properties
Name Type Description dirstring Directory name.
callbackfunction Callback when done.
-
<static> generateIndexTest(config, callback)
-
Generate index test file.
Parameters:
Name Type Description configobject Task configuration.
Properties
Name Type Description srcDirstring Source directory name.
destDirstring Destination directory name.
callbackfunction Callback when done.
-
<static> generateInstruments(config, callback)
-
Generate instruments for coverage report.
Parameters:
Name Type Description configobject Task configuration.
Properties
Name Type Description srcDirstring Source directory.
testDirstring Test files directory.
instrumentsDirstring Instruments root directory name.
callbackfunction Callback when done.
-
<static> generatePackageJson(config, callback)
-
Generate a package json from a apemanfile.
Parameters:
Name Type Description configobject Task configuration
Properties
Name Type Description srcstring Apemanfile file name.
deststring Destination file name.
callbackfunction Callback when done.
-
<static> generateSizedImageFiles(config, callback)
-
Generate sized images
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Description srcstring Source image path.
sizesarray Sizes of images.
deststring Dest file path pattern.
callbackfunction Callback when done.
Example
resizeImageFiles({ src: 'src/img/favicon.png', size:[ {width:32, height:32}, {width:64, height:64} ], dest:'public/img/favicon-{{width}}x{{height}}.png }, function(err){ console.log('done!'); }); -
<static> generateStructure(config, data, callback)
-
Generate project structure.
Parameters:
Name Type Description configobject Configuration object.
dataobject Structure data.
callbackfunction Callback when done.
Example
buildStructure({ "lib": { "string": { "_prototype.js": { "_type": "file", "__serializable": true, "_tmpl": "/Users/okuni/WebstormProjects/apeman/sites/apeman.info/abstract/tmpl/js/_prototype.js.hbs", "_data": { "requireName": "prototype/lib/string", "exportsName": "lib.string._prototype" }, "_force": true, "_mode": "444" } }, } }, function(err){ console.log('done!'); }); -
<static> generateStyleguide(config, callback)
-
Generate api guide document. Using jsdoc.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Description srcstring Source files to generate jsdoc. Could be a glob pattern.
destDirstring Directory to generate documents.
themestring Theme name. Valid options are "amelia","cerulean","cosmo","cyborg","flatly","journal","readable", "simplex","slate","spacelab","spruce","superhero","united"
callbackfunction Callback when done.
- Source:
- See:
-
<static> generateStyleguide(config, callback)
-
Generate style guide document wit KSS.
Parameters:
Name Type Description configobject Work configuration
Properties
Name Type Description srcDirstring | Array.<string> Stylesheet source directory.
destDirstring Directory to create the document.
aliasesobject Aliases to create inside the dest directory.
callbackfunction Callback when done.
- Source:
- See:
-
<static> generateStyleguideLess(config, callback)
-
Generate a fonts less file from available font files.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Description deststring Destination directory.
callbackfunction Callback when done.
-
<static> generateTestFiles(config, callback)
-
Generate test files unless exist.
Parameters:
Name Type Description configobject Task configuration.
Properties
Name Type Description srcDirstring Source files directory.
destDirstring Destination test directory.
callbackfunction Callback when done.
-
<static> generateTestFiles(config, callback)
-
Generate test files unless exist.
Parameters:
Name Type Description configobject Task configuration.
Properties
Name Type Argument Default Description srcDirstring Source files directory.
ignorestring <optional>
Ignore file pattern. Glob.
patternstring <optional>
'*' Source file pattern. Glob.
destDirstring Destination test directory.
testFilenamePrefixstring <optional>
"" Test filename prefix.
testFilenameSuffixstring <optional>
"_test" Test filename suffix.
dataobject <optional>
Test template data.
capitalizeboolean <optional>
false Capitalize the module name in the test file.
tmplstring Test file template file name.
callbackfunction Callback when done.
-
<static> generateThemeFaviconFiles(config, callback)
-
Generate theme startup image files.
Parameters:
Name Type Description configobject Task configuration
Properties
Name Type Argument Default Description destDirstring Destination directory.
countnumber <optional>
12 Number of favicons to generate.
callbackfunction Callback when done.
-
<static> generateThemeFaviconFiles(config, callback)
-
Generate theme favicon files.
Parameters:
Name Type Description configobject Task configuration
Properties
Name Type Argument Default Description destDirstring Destination directory.
letterstring A letter to print on favicon.
sizenumber <optional>
256 favicon size.
countnumber <optional>
12 Number of favicons to generate.
roundsnumber[] <optional>
[0,40,80] Corner radius patterns.
bordersnumber[] <optional>
[0,10,20] Border width patterns.
callbackfunction Callback when done.
-
<static> generateThemeLessFiles(config, callback)
-
Generate themes less.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Description dataFilestring Themes data file.
destDirstring Destination directory.
callbackfunction Callback when done.
-
<static> installBowerComponents(config, callback)
-
Install bower components.
Parameters:
Name Type Description configobject Task configuration.s
Properties
Name Type Description destDirstring Destination directory.
packagesobject Packages to install. Keys are package names, values are package versions.
callbackfunction Callback when done.
Example
installBowerComponents({ jquery: '~2.1.0' }); -
<static> installNodeModules(config, callback)
-
Install node modules. Uses npm install command.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Description packagesobject Packages data. Same as npm dependencies.
callbackfunction Callback when done.
- Source:
- See:
-
<static> linkNpmPackage(config, callback)
-
Link a npm package if missing.
Parameters:
Name Type Description configobject Task configuration.
Properties
Name Type Description packageNamestring Package name to link.
callbackfunction Callback when done.
-
<static> linkThemeImageFiles.(config, callback)
-
Link theme image files.
Parameters:
Name Type Description configobject Task configuration.
Properties
Name Type Description srcDirstring Source files directory.
destDirstring Destination directory.
settingFilestring Setting file name.
themeNamestring Theme name. ('a', 'b' or 'c'...)
callbackfunction Callback when done.
-
<static> minifyCssFiles(config, callback)
-
Minify css files.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Description srcDirstring Source css directory.
ignorestring Ignore css pattern. Glob.
patternstring Source css file pattern. Glob.
destDirstring Destination html directory.
callbackfunction Callback when done.
-
<static> minifyJsFiles(config, callback)
-
Minify javascript files.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Description srcDirstring Source js directory.
ignorestring Ignore js pattern. Glob.
patternstring Source js file pattern. Glob.
destDirstring Destination html directory.
callbackfunction Callback when done.
-
<static> packNpmPackage(config, callback)
-
Pack an app as npm package.
Parameters:
Name Type Description configobject Task configuration.
Properties
Name Type Description basedirstring App dir to pack.
callbackfunction Callback when done.
-
<static> publishHtmlFiles(config, callback)
-
Publish html files.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Description srcDirstring Source html directory.
ignorestring Ignore html pattern. Glob.
patternstring Source html file pattern. Glob.
destDirstring Destination html directory.
callbackfunction Callback when done.
-
<static> publishStaticFiles(config, callback)
-
Publish static files with symbolic link.
Parameters:
Name Type Description configobject Task configuration.
Properties
Name Type Description srcDirstring Source jade directory.
ignorestring Ignore jade pattern. Glob.
patternstring Source jade file pattern. Glob.
destDirstring Destination html directory.
callbackfunction Callback when done.
-
<static> reportToCoveralls(config, callback)
-
Post coverage data to coveralls.
Parameters:
Name Type Description configobject Task configuration.
Properties
Name Type Description filesstring[] nodeunit test files.
callbackfunction Callback when done.
- Source:
- See:
-
<static> runKarmaTest(config, callback)
-
Run karma test.
Parameters:
Name Type Description configobject Task configuration.
Properties
Name Type Description karmaConfigFilestring Karma config file path.
callbackfunction Callback when done.
-
<static> runMocha(config, callback)
-
Run mocha tests.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Description filesstring[] mocha test files.
timeoutnumber Timeout duration.
callbackfunction Callback when done.
-
<static> runNodeunit(config, callback)
-
Run nodeunit tests.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Description reporterstring nodeunit reporter.
filesstring[] nodeunit test files.
callbackfunction Callback when done.
-
<static> runTest(config, callback)
-
Run tests.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Description filesstring[] mocha test files.
runnerFilestring Test runner file.
runArgsstring[] Args to pass to the runner
callbackfunction Callback when done.
-
<static> watchFilesForTask(config, callback)
-
Watch files to execute task.
Parameters:
Name Type Description configobject Work configuration.
Properties
Name Type Argument Default Description taskstring Task name to execute.
timeoutnumber <optional>
50000 Timeout milliseconds.
dirstring | Array.<string> Directories to watch. Glob.
callbackfunction Callback when done.