Namespace: worker

task. worker

Task worker modules

Author:
  • Taka Okunishi
Source:

Namespaces

_debug

Methods

<static> _basenameWithoutExt(filename) → {string}

Get file basename without extension.

Parameters:
Name Type Description
filename string

File name.

Author:
  • Taka Okunishi
Source:
Returns:
  • Basename without extension.
Type
string

<static> _convertDirectory(config, callback)

Parameters:
Name Type Description
config object
Properties
Name Type Description
srcDir string

Source jade directory.

ignore string

Ignore jade pattern. Glob.

pattern string

Source jade file pattern. Glob.

destDir string

Destination html directory.

fileNameConverter function

Function to convert file name.

fileContentConverter function

Function to convert file content.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> beautifyJavascriptString(jsString) → {*}

Beautify javascript string.

Parameters:
Name Type Description
jsString string

Javascript string to beautify.

Source:
See:
Returns:
Type
*

<static> changeMode(config, callback)

Change permissions

Parameters:
Name Type Description
config object

Configuration object

Properties
Name Type Description
mode string

File mode to set.

pattern string

File path patterns.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
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
config object

Configuration object.

Properties
Name Type Argument Default Description
basedir string <optional>
'.'

Directory to clean.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> cleanDirectory(config, callback)

Clean a directory.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
dir string

Directory to clean. Can be a glob pattern.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> compileCoffeeDirectory(config, callback)

Compile coffee files in directory.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Source coffee directory.

ignore string

Ignore file pattern. Glob.

pattern string

Source coffee file pattern. Glob.

destDir string

Destination js directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> compileJadeDirectory(config, callback)

Compile jade files in directory.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Source jade directory.

ignore string

Ignore jade pattern. Glob.

minify boolean

Minify file or not.

dataFile string

File name which contains jade render context data.

pattern string

Source jade file pattern. Glob.

destDir string

Destination html directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> compileJadeDirectory(config, callback)

Compile jade files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Source jade directory.

ignore string

Ignore jade pattern. Glob.

pattern string

Source jade file pattern. Glob.

destDir string

Destination html directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> compileLessFiles(config, callback)

Compile less files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Source jade directory.

ignore string

Ignore jade pattern. Glob.

pattern string

Source jade file pattern. Glob.

destDir string

Destination html directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> concatFiles(config, callback)

Concat files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Argument Description
src string

Filename pattern. Glob.

ignore string <optional>

Ignore file pattern. Glob.

dest string

Destination file name.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> execCommand(config, callback)

Execute a command.

Parameters:
Name Type Description
config object

Task configuration

Properties
Name Type Description
command string

Command.

cwd string

Working directory name.

callback function

Callback when done.

Source:

<static> executeTravisEncrypt(config, callback)

Execute travis encrypt command.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
secretFile string

Secret file.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
See:

<static> generateApemanHelperData(config, callback)

Generate .apemanhelperdata file.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
dest string

Destination file name.

callback function

Callback when done.

Source:

Generate basename links. No matter how deep target files are, link file name put direct under the destination directory.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
src string

Source files with glob patterns.

linkDir string

Directory to create links.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateClientsideLocaleFiles(config, callback)

Generate public locale files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Locale source directory name.

destDir string

Public directory name.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateColorLess(config, callback)

Generate color less.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
dest string

Destination file name.

srcPattern string

Source file name pattern.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateColorThemesLessFiles(config, callback)

Generate api guide document. Using jsdoc.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
destDir string

Destination directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateConstantsJson(config, callback)

Generate path names json file.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
dest string

Destination file name.

data string

Constants data.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
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
config object

Work configuration.

Properties
Name Type Description
src string

Source file names. Glob.

ignore string

Ignore filename pattern. Glob.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateDataJson(config, callback)

Generate a data json file.

Parameters:
Name Type Description
config object

Task configuration

Properties
Name Type Description
dest string

Destination file name.

data object

Json data.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateFontsLessFiles(config, callback)

Generate a fonts less file from available font files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Argument Default Description
destDir string

Destination directory.

ignore string

Glob file patterns to ignore.

nameFormat string <optional>
'%s.less'

Less file name format.

fontFiles string

Glob file patterns for font files to collect.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateHtmlFromMarkdown(config, callback)

Generate a html file from markdown.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
src string

Source markdown file path.

dest string

Destination html file path.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateIcoImage(config, callback)

Generate an icon file from a png file.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
src string

Source png file path.

dest string

Destination ico file path.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateIndex(config, callback)

Create a index.js for the given directory. Exports files in directory with camelized name.

Parameters:
Name Type Description
config object

Configuration object.

Properties
Name Type Argument Default Description
dir string

Directory to create index.

capitalize boolean <optional>
false

Exports with capitalize name or not.

pattern string <optional>
'*'

Pattern to collect modules within the directory.

dest string <optional>
config.dir+'/index.js'

Index file path to generate.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
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
config object

Task configuration.

Properties
Name Type Description
dir string

Directory name.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateIndexTest(config, callback)

Generate index test file.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
srcDir string

Source directory name.

destDir string

Destination directory name.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateInstruments(config, callback)

Generate instruments for coverage report.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
srcDir string

Source directory.

testDir string

Test files directory.

instrumentsDir string

Instruments root directory name.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generatePackageJson(config, callback)

Generate a package json from a apemanfile.

Parameters:
Name Type Description
config object

Task configuration

Properties
Name Type Description
src string

Apemanfile file name.

dest string

Destination file name.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateSizedImageFiles(config, callback)

Generate sized images

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
src string

Source image path.

sizes array

Sizes of images.

dest string

Dest file path pattern.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
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
config object

Configuration object.

data object

Structure data.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
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
config object

Work configuration.

Properties
Name Type Description
src string

Source files to generate jsdoc. Could be a glob pattern.

destDir string

Directory to generate documents.

theme string

Theme name. Valid options are "amelia","cerulean","cosmo","cyborg","flatly","journal","readable", "simplex","slate","spacelab","spruce","superhero","united"

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
See:

<static> generateStyleguide(config, callback)

Generate style guide document wit KSS.

Parameters:
Name Type Description
config object

Work configuration

Properties
Name Type Description
srcDir string | Array.<string>

Stylesheet source directory.

destDir string

Directory to create the document.

aliases object

Aliases to create inside the dest directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
See:

<static> generateStyleguideLess(config, callback)

Generate a fonts less file from available font files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
dest string

Destination directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateTestFiles(config, callback)

Generate test files unless exist.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
srcDir string

Source files directory.

destDir string

Destination test directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateTestFiles(config, callback)

Generate test files unless exist.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Argument Default Description
srcDir string

Source files directory.

ignore string <optional>

Ignore file pattern. Glob.

pattern string <optional>
'*'

Source file pattern. Glob.

destDir string

Destination test directory.

testFilenamePrefix string <optional>
""

Test filename prefix.

testFilenameSuffix string <optional>
"_test"

Test filename suffix.

data object <optional>

Test template data.

capitalize boolean <optional>
false

Capitalize the module name in the test file.

tmpl string

Test file template file name.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateThemeFaviconFiles(config, callback)

Generate theme startup image files.

Parameters:
Name Type Description
config object

Task configuration

Properties
Name Type Argument Default Description
destDir string

Destination directory.

count number <optional>
12

Number of favicons to generate.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateThemeFaviconFiles(config, callback)

Generate theme favicon files.

Parameters:
Name Type Description
config object

Task configuration

Properties
Name Type Argument Default Description
destDir string

Destination directory.

letter string

A letter to print on favicon.

size number <optional>
256

favicon size.

count number <optional>
12

Number of favicons to generate.

rounds number[] <optional>
[0,40,80]

Corner radius patterns.

borders number[] <optional>
[0,10,20]

Border width patterns.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateThemeLessFiles(config, callback)

Generate themes less.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
dataFile string

Themes data file.

destDir string

Destination directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> installBowerComponents(config, callback)

Install bower components.

Parameters:
Name Type Description
config object

Task configuration.s

Properties
Name Type Description
destDir string

Destination directory.

packages object

Packages to install. Keys are package names, values are package versions.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
Example
installBowerComponents({
    jquery: '~2.1.0'
});

<static> installNodeModules(config, callback)

Install node modules. Uses npm install command.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
packages object

Packages data. Same as npm dependencies.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
See:

<static> linkNpmPackage(config, callback)

Link a npm package if missing.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
packageName string

Package name to link.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> linkThemeImageFiles.(config, callback)

Link theme image files.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
srcDir string

Source files directory.

destDir string

Destination directory.

settingFile string

Setting file name.

themeName string

Theme name. ('a', 'b' or 'c'...)

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> minifyCssFiles(config, callback)

Minify css files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Source css directory.

ignore string

Ignore css pattern. Glob.

pattern string

Source css file pattern. Glob.

destDir string

Destination html directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> minifyJsFiles(config, callback)

Minify javascript files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Source js directory.

ignore string

Ignore js pattern. Glob.

pattern string

Source js file pattern. Glob.

destDir string

Destination html directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> packNpmPackage(config, callback)

Pack an app as npm package.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
basedir string

App dir to pack.

callback function

Callback when done.

Source:

<static> publishHtmlFiles(config, callback)

Publish html files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Source html directory.

ignore string

Ignore html pattern. Glob.

pattern string

Source html file pattern. Glob.

destDir string

Destination html directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> publishStaticFiles(config, callback)

Publish static files with symbolic link.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
srcDir string

Source jade directory.

ignore string

Ignore jade pattern. Glob.

pattern string

Source jade file pattern. Glob.

destDir string

Destination html directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> reportToCoveralls(config, callback)

Post coverage data to coveralls.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
files string[]

nodeunit test files.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
See:

<static> runKarmaTest(config, callback)

Run karma test.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
karmaConfigFile string

Karma config file path.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> runMocha(config, callback)

Run mocha tests.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
files string[]

mocha test files.

timeout number

Timeout duration.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> runNodeunit(config, callback)

Run nodeunit tests.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
reporter string

nodeunit reporter.

files string[]

nodeunit test files.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> runTest(config, callback)

Run tests.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
files string[]

mocha test files.

runnerFile string

Test runner file.

runArgs string[]

Args to pass to the runner

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> watchFilesForTask(config, callback)

Watch files to execute task.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Argument Default Description
task string

Task name to execute.

timeout number <optional>
50000

Timeout milliseconds.

dir string | Array.<string>

Directories to watch. Glob.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

Namespace: worker

task. worker

Task worker modules

Author:
  • Taka Okunishi
Source:

Namespaces

_debug

Methods

<static> _basenameWithoutExt(filename) → {string}

Get file basename without extension.

Parameters:
Name Type Description
filename string

File name.

Author:
  • Taka Okunishi
Source:
Returns:
  • Basename without extension.
Type
string

<static> _convertDirectory(config, callback)

Parameters:
Name Type Description
config object
Properties
Name Type Description
srcDir string

Source jade directory.

ignore string

Ignore jade pattern. Glob.

pattern string

Source jade file pattern. Glob.

destDir string

Destination html directory.

fileNameConverter function

Function to convert file name.

fileContentConverter function

Function to convert file content.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> beautifyJavascriptString(jsString) → {*}

Beautify javascript string.

Parameters:
Name Type Description
jsString string

Javascript string to beautify.

Source:
See:
Returns:
Type
*

<static> changeMode(config, callback)

Change permissions

Parameters:
Name Type Description
config object

Configuration object

Properties
Name Type Description
mode string

File mode to set.

pattern string

File path patterns.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
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
config object

Configuration object.

Properties
Name Type Argument Default Description
basedir string <optional>
'.'

Directory to clean.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> cleanDirectory(config, callback)

Clean a directory.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
dir string

Directory to clean. Can be a glob pattern.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> compileCoffeeDirectory(config, callback)

Compile coffee files in directory.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Source coffee directory.

ignore string

Ignore file pattern. Glob.

pattern string

Source coffee file pattern. Glob.

destDir string

Destination js directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> compileJadeDirectory(config, callback)

Compile jade files in directory.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Source jade directory.

ignore string

Ignore jade pattern. Glob.

minify boolean

Minify file or not.

dataFile string

File name which contains jade render context data.

pattern string

Source jade file pattern. Glob.

destDir string

Destination html directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> compileJadeDirectory(config, callback)

Compile jade files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Source jade directory.

ignore string

Ignore jade pattern. Glob.

pattern string

Source jade file pattern. Glob.

destDir string

Destination html directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> compileLessFiles(config, callback)

Compile less files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Source jade directory.

ignore string

Ignore jade pattern. Glob.

pattern string

Source jade file pattern. Glob.

destDir string

Destination html directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> concatFiles(config, callback)

Concat files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Argument Description
src string

Filename pattern. Glob.

ignore string <optional>

Ignore file pattern. Glob.

dest string

Destination file name.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> execCommand(config, callback)

Execute a command.

Parameters:
Name Type Description
config object

Task configuration

Properties
Name Type Description
command string

Command.

cwd string

Working directory name.

callback function

Callback when done.

Source:

<static> executeTravisEncrypt(config, callback)

Execute travis encrypt command.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
secretFile string

Secret file.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
See:

<static> generateApemanHelperData(config, callback)

Generate .apemanhelperdata file.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
dest string

Destination file name.

callback function

Callback when done.

Source:

Generate basename links. No matter how deep target files are, link file name put direct under the destination directory.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
src string

Source files with glob patterns.

linkDir string

Directory to create links.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateClientsideLocaleFiles(config, callback)

Generate public locale files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Locale source directory name.

destDir string

Public directory name.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateColorLess(config, callback)

Generate color less.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
dest string

Destination file name.

srcPattern string

Source file name pattern.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateColorThemesLessFiles(config, callback)

Generate api guide document. Using jsdoc.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
destDir string

Destination directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateConstantsJson(config, callback)

Generate path names json file.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
dest string

Destination file name.

data string

Constants data.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
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
config object

Work configuration.

Properties
Name Type Description
src string

Source file names. Glob.

ignore string

Ignore filename pattern. Glob.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateDataJson(config, callback)

Generate a data json file.

Parameters:
Name Type Description
config object

Task configuration

Properties
Name Type Description
dest string

Destination file name.

data object

Json data.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateFontsLessFiles(config, callback)

Generate a fonts less file from available font files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Argument Default Description
destDir string

Destination directory.

ignore string

Glob file patterns to ignore.

nameFormat string <optional>
'%s.less'

Less file name format.

fontFiles string

Glob file patterns for font files to collect.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateHtmlFromMarkdown(config, callback)

Generate a html file from markdown.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
src string

Source markdown file path.

dest string

Destination html file path.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateIcoImage(config, callback)

Generate an icon file from a png file.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
src string

Source png file path.

dest string

Destination ico file path.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateIndex(config, callback)

Create a index.js for the given directory. Exports files in directory with camelized name.

Parameters:
Name Type Description
config object

Configuration object.

Properties
Name Type Argument Default Description
dir string

Directory to create index.

capitalize boolean <optional>
false

Exports with capitalize name or not.

pattern string <optional>
'*'

Pattern to collect modules within the directory.

dest string <optional>
config.dir+'/index.js'

Index file path to generate.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
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
config object

Task configuration.

Properties
Name Type Description
dir string

Directory name.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateIndexTest(config, callback)

Generate index test file.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
srcDir string

Source directory name.

destDir string

Destination directory name.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateInstruments(config, callback)

Generate instruments for coverage report.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
srcDir string

Source directory.

testDir string

Test files directory.

instrumentsDir string

Instruments root directory name.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generatePackageJson(config, callback)

Generate a package json from a apemanfile.

Parameters:
Name Type Description
config object

Task configuration

Properties
Name Type Description
src string

Apemanfile file name.

dest string

Destination file name.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateSizedImageFiles(config, callback)

Generate sized images

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
src string

Source image path.

sizes array

Sizes of images.

dest string

Dest file path pattern.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
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
config object

Configuration object.

data object

Structure data.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
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
config object

Work configuration.

Properties
Name Type Description
src string

Source files to generate jsdoc. Could be a glob pattern.

destDir string

Directory to generate documents.

theme string

Theme name. Valid options are "amelia","cerulean","cosmo","cyborg","flatly","journal","readable", "simplex","slate","spacelab","spruce","superhero","united"

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
See:

<static> generateStyleguide(config, callback)

Generate style guide document wit KSS.

Parameters:
Name Type Description
config object

Work configuration

Properties
Name Type Description
srcDir string | Array.<string>

Stylesheet source directory.

destDir string

Directory to create the document.

aliases object

Aliases to create inside the dest directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
See:

<static> generateStyleguideLess(config, callback)

Generate a fonts less file from available font files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
dest string

Destination directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateTestFiles(config, callback)

Generate test files unless exist.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
srcDir string

Source files directory.

destDir string

Destination test directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateTestFiles(config, callback)

Generate test files unless exist.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Argument Default Description
srcDir string

Source files directory.

ignore string <optional>

Ignore file pattern. Glob.

pattern string <optional>
'*'

Source file pattern. Glob.

destDir string

Destination test directory.

testFilenamePrefix string <optional>
""

Test filename prefix.

testFilenameSuffix string <optional>
"_test"

Test filename suffix.

data object <optional>

Test template data.

capitalize boolean <optional>
false

Capitalize the module name in the test file.

tmpl string

Test file template file name.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateThemeFaviconFiles(config, callback)

Generate theme startup image files.

Parameters:
Name Type Description
config object

Task configuration

Properties
Name Type Argument Default Description
destDir string

Destination directory.

count number <optional>
12

Number of favicons to generate.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateThemeFaviconFiles(config, callback)

Generate theme favicon files.

Parameters:
Name Type Description
config object

Task configuration

Properties
Name Type Argument Default Description
destDir string

Destination directory.

letter string

A letter to print on favicon.

size number <optional>
256

favicon size.

count number <optional>
12

Number of favicons to generate.

rounds number[] <optional>
[0,40,80]

Corner radius patterns.

borders number[] <optional>
[0,10,20]

Border width patterns.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateThemeLessFiles(config, callback)

Generate themes less.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
dataFile string

Themes data file.

destDir string

Destination directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> installBowerComponents(config, callback)

Install bower components.

Parameters:
Name Type Description
config object

Task configuration.s

Properties
Name Type Description
destDir string

Destination directory.

packages object

Packages to install. Keys are package names, values are package versions.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
Example
installBowerComponents({
    jquery: '~2.1.0'
});

<static> installNodeModules(config, callback)

Install node modules. Uses npm install command.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
packages object

Packages data. Same as npm dependencies.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
See:

<static> linkNpmPackage(config, callback)

Link a npm package if missing.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
packageName string

Package name to link.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> linkThemeImageFiles.(config, callback)

Link theme image files.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
srcDir string

Source files directory.

destDir string

Destination directory.

settingFile string

Setting file name.

themeName string

Theme name. ('a', 'b' or 'c'...)

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> minifyCssFiles(config, callback)

Minify css files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Source css directory.

ignore string

Ignore css pattern. Glob.

pattern string

Source css file pattern. Glob.

destDir string

Destination html directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> minifyJsFiles(config, callback)

Minify javascript files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Source js directory.

ignore string

Ignore js pattern. Glob.

pattern string

Source js file pattern. Glob.

destDir string

Destination html directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> packNpmPackage(config, callback)

Pack an app as npm package.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
basedir string

App dir to pack.

callback function

Callback when done.

Source:

<static> publishHtmlFiles(config, callback)

Publish html files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Source html directory.

ignore string

Ignore html pattern. Glob.

pattern string

Source html file pattern. Glob.

destDir string

Destination html directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> publishStaticFiles(config, callback)

Publish static files with symbolic link.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
srcDir string

Source jade directory.

ignore string

Ignore jade pattern. Glob.

pattern string

Source jade file pattern. Glob.

destDir string

Destination html directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> reportToCoveralls(config, callback)

Post coverage data to coveralls.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
files string[]

nodeunit test files.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
See:

<static> runKarmaTest(config, callback)

Run karma test.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
karmaConfigFile string

Karma config file path.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> runMocha(config, callback)

Run mocha tests.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
files string[]

mocha test files.

timeout number

Timeout duration.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> runNodeunit(config, callback)

Run nodeunit tests.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
reporter string

nodeunit reporter.

files string[]

nodeunit test files.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> runTest(config, callback)

Run tests.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
files string[]

mocha test files.

runnerFile string

Test runner file.

runArgs string[]

Args to pass to the runner

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> watchFilesForTask(config, callback)

Watch files to execute task.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Argument Default Description
task string

Task name to execute.

timeout number <optional>
50000

Timeout milliseconds.

dir string | Array.<string>

Directories to watch. Glob.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

Namespace: worker

task. worker

Task worker modules

Author:
  • Taka Okunishi
Source:

Namespaces

_debug

Methods

<static> _basenameWithoutExt(filename) → {string}

Get file basename without extension.

Parameters:
Name Type Description
filename string

File name.

Author:
  • Taka Okunishi
Source:
Returns:
  • Basename without extension.
Type
string

<static> _convertDirectory(config, callback)

Parameters:
Name Type Description
config object
Properties
Name Type Description
srcDir string

Source jade directory.

ignore string

Ignore jade pattern. Glob.

pattern string

Source jade file pattern. Glob.

destDir string

Destination html directory.

fileNameConverter function

Function to convert file name.

fileContentConverter function

Function to convert file content.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> beautifyJavascriptString(jsString) → {*}

Beautify javascript string.

Parameters:
Name Type Description
jsString string

Javascript string to beautify.

Source:
See:
Returns:
Type
*

<static> changeMode(config, callback)

Change permissions

Parameters:
Name Type Description
config object

Configuration object

Properties
Name Type Description
mode string

File mode to set.

pattern string

File path patterns.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
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
config object

Configuration object.

Properties
Name Type Argument Default Description
basedir string <optional>
'.'

Directory to clean.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> cleanDirectory(config, callback)

Clean a directory.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
dir string

Directory to clean. Can be a glob pattern.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> compileCoffeeDirectory(config, callback)

Compile coffee files in directory.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Source coffee directory.

ignore string

Ignore file pattern. Glob.

pattern string

Source coffee file pattern. Glob.

destDir string

Destination js directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> compileJadeDirectory(config, callback)

Compile jade files in directory.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Source jade directory.

ignore string

Ignore jade pattern. Glob.

minify boolean

Minify file or not.

dataFile string

File name which contains jade render context data.

pattern string

Source jade file pattern. Glob.

destDir string

Destination html directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> compileJadeDirectory(config, callback)

Compile jade files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Source jade directory.

ignore string

Ignore jade pattern. Glob.

pattern string

Source jade file pattern. Glob.

destDir string

Destination html directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> compileLessFiles(config, callback)

Compile less files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Source jade directory.

ignore string

Ignore jade pattern. Glob.

pattern string

Source jade file pattern. Glob.

destDir string

Destination html directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> concatFiles(config, callback)

Concat files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Argument Description
src string

Filename pattern. Glob.

ignore string <optional>

Ignore file pattern. Glob.

dest string

Destination file name.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> execCommand(config, callback)

Execute a command.

Parameters:
Name Type Description
config object

Task configuration

Properties
Name Type Description
command string

Command.

cwd string

Working directory name.

callback function

Callback when done.

Source:

<static> executeTravisEncrypt(config, callback)

Execute travis encrypt command.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
secretFile string

Secret file.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
See:

<static> generateApemanHelperData(config, callback)

Generate .apemanhelperdata file.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
dest string

Destination file name.

callback function

Callback when done.

Source:

Generate basename links. No matter how deep target files are, link file name put direct under the destination directory.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
src string

Source files with glob patterns.

linkDir string

Directory to create links.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateClientsideLocaleFiles(config, callback)

Generate public locale files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Locale source directory name.

destDir string

Public directory name.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateColorLess(config, callback)

Generate color less.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
dest string

Destination file name.

srcPattern string

Source file name pattern.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateColorThemesLessFiles(config, callback)

Generate api guide document. Using jsdoc.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
destDir string

Destination directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateConstantsJson(config, callback)

Generate path names json file.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
dest string

Destination file name.

data string

Constants data.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
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
config object

Work configuration.

Properties
Name Type Description
src string

Source file names. Glob.

ignore string

Ignore filename pattern. Glob.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateDataJson(config, callback)

Generate a data json file.

Parameters:
Name Type Description
config object

Task configuration

Properties
Name Type Description
dest string

Destination file name.

data object

Json data.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateFontsLessFiles(config, callback)

Generate a fonts less file from available font files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Argument Default Description
destDir string

Destination directory.

ignore string

Glob file patterns to ignore.

nameFormat string <optional>
'%s.less'

Less file name format.

fontFiles string

Glob file patterns for font files to collect.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateHtmlFromMarkdown(config, callback)

Generate a html file from markdown.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
src string

Source markdown file path.

dest string

Destination html file path.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateIcoImage(config, callback)

Generate an icon file from a png file.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
src string

Source png file path.

dest string

Destination ico file path.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateIndex(config, callback)

Create a index.js for the given directory. Exports files in directory with camelized name.

Parameters:
Name Type Description
config object

Configuration object.

Properties
Name Type Argument Default Description
dir string

Directory to create index.

capitalize boolean <optional>
false

Exports with capitalize name or not.

pattern string <optional>
'*'

Pattern to collect modules within the directory.

dest string <optional>
config.dir+'/index.js'

Index file path to generate.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
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
config object

Task configuration.

Properties
Name Type Description
dir string

Directory name.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateIndexTest(config, callback)

Generate index test file.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
srcDir string

Source directory name.

destDir string

Destination directory name.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateInstruments(config, callback)

Generate instruments for coverage report.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
srcDir string

Source directory.

testDir string

Test files directory.

instrumentsDir string

Instruments root directory name.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generatePackageJson(config, callback)

Generate a package json from a apemanfile.

Parameters:
Name Type Description
config object

Task configuration

Properties
Name Type Description
src string

Apemanfile file name.

dest string

Destination file name.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateSizedImageFiles(config, callback)

Generate sized images

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
src string

Source image path.

sizes array

Sizes of images.

dest string

Dest file path pattern.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
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
config object

Configuration object.

data object

Structure data.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
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
config object

Work configuration.

Properties
Name Type Description
src string

Source files to generate jsdoc. Could be a glob pattern.

destDir string

Directory to generate documents.

theme string

Theme name. Valid options are "amelia","cerulean","cosmo","cyborg","flatly","journal","readable", "simplex","slate","spacelab","spruce","superhero","united"

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
See:

<static> generateStyleguide(config, callback)

Generate style guide document wit KSS.

Parameters:
Name Type Description
config object

Work configuration

Properties
Name Type Description
srcDir string | Array.<string>

Stylesheet source directory.

destDir string

Directory to create the document.

aliases object

Aliases to create inside the dest directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
See:

<static> generateStyleguideLess(config, callback)

Generate a fonts less file from available font files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
dest string

Destination directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateTestFiles(config, callback)

Generate test files unless exist.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
srcDir string

Source files directory.

destDir string

Destination test directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateTestFiles(config, callback)

Generate test files unless exist.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Argument Default Description
srcDir string

Source files directory.

ignore string <optional>

Ignore file pattern. Glob.

pattern string <optional>
'*'

Source file pattern. Glob.

destDir string

Destination test directory.

testFilenamePrefix string <optional>
""

Test filename prefix.

testFilenameSuffix string <optional>
"_test"

Test filename suffix.

data object <optional>

Test template data.

capitalize boolean <optional>
false

Capitalize the module name in the test file.

tmpl string

Test file template file name.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateThemeFaviconFiles(config, callback)

Generate theme startup image files.

Parameters:
Name Type Description
config object

Task configuration

Properties
Name Type Argument Default Description
destDir string

Destination directory.

count number <optional>
12

Number of favicons to generate.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateThemeFaviconFiles(config, callback)

Generate theme favicon files.

Parameters:
Name Type Description
config object

Task configuration

Properties
Name Type Argument Default Description
destDir string

Destination directory.

letter string

A letter to print on favicon.

size number <optional>
256

favicon size.

count number <optional>
12

Number of favicons to generate.

rounds number[] <optional>
[0,40,80]

Corner radius patterns.

borders number[] <optional>
[0,10,20]

Border width patterns.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> generateThemeLessFiles(config, callback)

Generate themes less.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
dataFile string

Themes data file.

destDir string

Destination directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> installBowerComponents(config, callback)

Install bower components.

Parameters:
Name Type Description
config object

Task configuration.s

Properties
Name Type Description
destDir string

Destination directory.

packages object

Packages to install. Keys are package names, values are package versions.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
Example
installBowerComponents({
    jquery: '~2.1.0'
});

<static> installNodeModules(config, callback)

Install node modules. Uses npm install command.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
packages object

Packages data. Same as npm dependencies.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
See:

<static> linkNpmPackage(config, callback)

Link a npm package if missing.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
packageName string

Package name to link.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> linkThemeImageFiles.(config, callback)

Link theme image files.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
srcDir string

Source files directory.

destDir string

Destination directory.

settingFile string

Setting file name.

themeName string

Theme name. ('a', 'b' or 'c'...)

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> minifyCssFiles(config, callback)

Minify css files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Source css directory.

ignore string

Ignore css pattern. Glob.

pattern string

Source css file pattern. Glob.

destDir string

Destination html directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> minifyJsFiles(config, callback)

Minify javascript files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Source js directory.

ignore string

Ignore js pattern. Glob.

pattern string

Source js file pattern. Glob.

destDir string

Destination html directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> packNpmPackage(config, callback)

Pack an app as npm package.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
basedir string

App dir to pack.

callback function

Callback when done.

Source:

<static> publishHtmlFiles(config, callback)

Publish html files.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
srcDir string

Source html directory.

ignore string

Ignore html pattern. Glob.

pattern string

Source html file pattern. Glob.

destDir string

Destination html directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> publishStaticFiles(config, callback)

Publish static files with symbolic link.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
srcDir string

Source jade directory.

ignore string

Ignore jade pattern. Glob.

pattern string

Source jade file pattern. Glob.

destDir string

Destination html directory.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> reportToCoveralls(config, callback)

Post coverage data to coveralls.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
files string[]

nodeunit test files.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
See:

<static> runKarmaTest(config, callback)

Run karma test.

Parameters:
Name Type Description
config object

Task configuration.

Properties
Name Type Description
karmaConfigFile string

Karma config file path.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> runMocha(config, callback)

Run mocha tests.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
files string[]

mocha test files.

timeout number

Timeout duration.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> runNodeunit(config, callback)

Run nodeunit tests.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
reporter string

nodeunit reporter.

files string[]

nodeunit test files.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> runTest(config, callback)

Run tests.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Description
files string[]

mocha test files.

runnerFile string

Test runner file.

runArgs string[]

Args to pass to the runner

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> watchFilesForTask(config, callback)

Watch files to execute task.

Parameters:
Name Type Description
config object

Work configuration.

Properties
Name Type Argument Default Description
task string

Task name to execute.

timeout number <optional>
50000

Timeout milliseconds.

dir string | Array.<string>

Directories to watch. Glob.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source: