Skip to content

Commit

Permalink
#50 Fix pr notations from @neige
Browse files Browse the repository at this point in the history
  • Loading branch information
tormozz48 committed Jul 31, 2015
1 parent 41f773c commit 2d25431
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 49 deletions.
8 changes: 4 additions & 4 deletions lib/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ var EOL = require('os').EOL,
/**
* Compiles code of i18n.
*
* @param {Object} parsed info from keysets file,
* @param {String} language — language of keysets,
* @param {Object} parsed info from keysets file
* @param {String} language — language of keysets
* example: `{ scope: { key: 'val' } }`. The value can be a function,
* example: `{ scope: { key: function (params, i18n) { return 'res'; } } }`.
*
Expand All @@ -21,7 +21,7 @@ module.exports = function (parsed, language) {

/**
* Compiles i18n function for bem-bl localization system
* @param {String} core — bem-core i18n core code string
* @param {String} core — code string that contains i18n core of bem-core library
* @param {Object} keysets — keysets hash
* @param {String} language — language of keysets
* @returns {String}
Expand Down Expand Up @@ -49,7 +49,7 @@ function compileForVersion1(core, keysets, language) {
* Return decl function call code string for given keyset scope
* @param {String} scopeName - name of scope
* @param {Object} scope hash object
* @param {String} lang - language option value
* @param {String} lang language option value
* @returns {String|*}
* @private
*/
Expand Down
12 changes: 6 additions & 6 deletions techs/bemxjst/bemhtml-i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ var EOL = require('os').EOL,
* <br/>
* Localization is based on pre-built `?.keysets.{lang}.js` bundle files.<br/><br/>
*
* Important: It supports only JS syntax by default. Use `compat` option to support old BEMHTML syntax.
* Important: It supports only JavaScript syntax by default. Use `compat` option to support old BEMHTML syntax.
*
* @param {Object} [options] Options
* @param {String} [options.target='?.bemhtml.{lang}.js'] Path to target with compiled file.
* @param {String} [options.target='?.bemhtml.{lang}.js'] Path to a target with compiled file.
* @param {String} options.lang Language identifier.
* @param {String} [options.exportName='BEMHTML'] Name of BEMHTML template variable.
* @param {Boolean} [options.compat=false] Set `compat` option to support old BEMHTML syntax.
* @param {Boolean} [options.devMode=true] Set `devMode` option for convenient debugging.
* @param {Boolean} [options.compat=false] Sets `compat` option to support old BEMHTML syntax.
* @param {Boolean} [options.devMode=true] Sets `devMode` option for convenient debugging.
* If `devMode` is set to true, code of templates will
* not be compiled but only wrapped for development
* purposes.
* @param {Boolean} [options.cache=false] Set `cache` option for cache usage.
* @param {Boolean} [options.cache=false] Sets `cache` option for cache usage.
* @param {Object} [options.requires] Names of dependencies which should be available from
* code of templates.
* @param {String[]} [options.sourceSuffixes] Files with specified suffixes involved in the
* assembly.
* @param {String} [options.keysetsFile='?.keysets.{lang}.js'] Path to source keysets file.
* @param {String} [options.keysetsFile='?.keysets.{lang}.js'] Path to a source keysets file.
*
* @example
* var BemhtmlI18nTech = require('enb-bem-i18n/techs/bemxjst/bemhtml-i18n'),
Expand Down
26 changes: 13 additions & 13 deletions techs/bh-bundle-i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,34 @@ var vow = require('vow'),
* @augments {BHBundleTech}
* @classdesc
*
* Builds localized file with commonJS requires for core and each bh template (bh.js files).<br/><br/>
* Builds localized file with CommonJS requires for core and each BH template (`bh.js` files).<br/><br/>
*
* Localization is based on pre-built `?.keysets.{lang}.js` bundle files.<br/><br/>
*
* Use to apply in browsers and on server side (Node.js).<br/><br/>
* Use in browsers and on server side (Node.js).<br/><br/>
*
* The compiled BH module supports CommonJS and YModules. If there is no any modular system in the runtime,
* the module will be provided as global variable `BH`.<br/><br/>
*
* Important: do not use `require` in templates.
*
* @param {Object} options Options.
* @param {String} [options.target='?.bh.{lang}.js'] Path to target with compiled file.
* @param {String} [options.target='?.bh.{lang}.js'] Path to a target with compiled file.
* @param {String} options.lang Language identifier.
* @param {String} [options.filesTarget='?.files'] Path to target with FileList.
* @param {String[]} [options.sourceSuffixes='bh.js'] Files with specified suffixes involved
* in the assembly.
* @param {Object} [options.requires] Names for dependencies to `BH.lib.name`.
* @param {String[]} [options.mimic] Names to export.
* @param {String} [options.scope='template'] Scope to execute templates in.
* @param {Boolean} [options.sourcemap=false] Include inline source maps.
* @param {String} [options.jsAttrName='data-bem'] Set `jsAttrName` option for BH core.
* @param {String} [options.jsAttrScheme='json'] Set `jsAttrScheme` option for BH core.
* @param {String} [options.jsCls='i-bem'] Set `jsCls` option for BH core.
* @param {Boolean} [options.jsElem=true] Set `jsElem` option for BH core.
* @param {Boolean} [options.escapeContent=false] Set `escapeContent` option for BH core.
* @param {Boolean} [options.clsNobaseMods=false] Set `clsNobaseMods` option for BH core.
* @param {String} [options.keysetsFile='?.keysets.{lang}.js'] Path to source keysets file.
* @param {String[]} [options.mimic] Names for export.
* @param {String} [options.scope='template'] Scope of templates execution.
* @param {Boolean} [options.sourcemap=false] Includes inline source maps.
* @param {String} [options.jsAttrName='data-bem'] Sets `jsAttrName` option for BH core.
* @param {String} [options.jsAttrScheme='json'] Sets `jsAttrScheme` option for BH core.
* @param {String} [options.jsCls='i-bem'] Sets `jsCls` option for BH core.
* @param {Boolean} [options.jsElem=true] Sets `jsElem` option for BH core.
* @param {Boolean} [options.escapeContent=false] Sets `escapeContent` option for BH core.
* @param {Boolean} [options.clsNobaseMods=false] Sets `clsNobaseMods` option for BH core.
* @param {String} [options.keysetsFile='?.keysets.{lang}.js'] Path to a source keysets file.
*
* @example
* var BHBundleI18nTech = require('enb-bh/techs/bh-bundle'),
Expand Down
22 changes: 11 additions & 11 deletions techs/bh-commonjs-i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,29 @@ var EOL = require('os').EOL,
* @augments {BHCommonJSTech}
* @classdesc
*
* Compiles localized CommonJS module of BH with requires of core and source templates (bh.js files).<br/><br/>
* Compiles localized CommonJS module of BH with requires of core and source templates (`bh.js` files).<br/><br/>
*
* Localization is based on pre-built `?.keysets.{lang}.js` bundle files.<br/><br/>
*
* Use to apply in server side only (Node.js). You can use `require` in templates.<br/><br/>
* Use on server side only (Node.js). You can use `require` in templates.<br/><br/>
*
* Important: for correct apply the source files and files are specified in `requires` should be in file system.
*
* @param {Object} options Options.
* @param {String} [options.target='?.bh.{lang}.js'] Path to target with compiled file.
* @param {String} [options.target='?.bh.{lang}.js'] Path to a target with compiled file.
* @param {String} options.lang Language identifier.
* @param {String} [options.filesTarget='?.files'] Path to target with FileList.
* @param {String[]} [options.sourceSuffixes='bh.js'] Files with specified suffixes involved in the
* assembly.
* @param {String[]} [options.mimic] Names to export.
* @param {Boolean} [options.devMode=true] Drop cache for `require` of source templates.
* @param {String} [options.jsAttrName='data-bem'] Set `jsAttrName` option for BH core.
* @param {String} [options.jsAttrScheme='json'] Set `jsAttrScheme` option for BH core.
* @param {String} [options.jsCls='i-bem'] Set `jsCls` option for BH core.
* @param {Boolean} [options.jsElem=true] Set `jsElem` option for BH core.
* @param {Boolean} [options.escapeContent=false] Set `escapeContent` option for BH core.
* @param {Boolean} [options.clsNobaseMods=false] Set `clsNobaseMods` option for BH core.
* @param {String} [options.keysetsFie='?.keysets.{lang}.js'] Path to source keysets file.
* @param {Boolean} [options.devMode=true] Drops cache for `require` of source templates.
* @param {String} [options.jsAttrName='data-bem'] Sets `jsAttrName` option for BH core.
* @param {String} [options.jsAttrScheme='json'] Sets `jsAttrScheme` option for BH core.
* @param {String} [options.jsCls='i-bem'] Sets `jsCls` option for BH core.
* @param {Boolean} [options.jsElem=true] Sets `jsElem` option for BH core.
* @param {Boolean} [options.escapeContent=false] Sets `escapeContent` option for BH core.
* @param {Boolean} [options.clsNobaseMods=false] Sets `clsNobaseMods` option for BH core.
* @param {String} [options.keysetsFie='?.keysets.{lang}.js'] Path to a source keysets file.
*
* @example
* var BHCommonJSI18nTech = require('enb-bem-i18n/techs/bh-commonjs-i18n'),
Expand Down
6 changes: 3 additions & 3 deletions techs/i18n-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ var EOL = require('os').EOL,
* @augments {BaseTech}
* @classdesc
*
* Builds `?.lang.{lang}.js` from `?.keysets.{lang}.js` bundle files<br/><br/>
* Builds `?.lang.{lang}.js` from `?.keysets.{lang}.js` bundle files.<br/><br/>
*
* @param {Object} options Options.
* @param {String} [options.target='?.lang.{lang}.js'] Path to target with compiled file.
* @param {String} [options.target='?.lang.{lang}.js'] Path to a target with compiled file.
* @param {String} options.lang Language identifier.
* @param {String} [options.keysetsFile='?.keysets.{lang}.js'] Path to source keysets file.
* @param {String} [options.keysetsFile='?.keysets.{lang}.js'] Path to a source keysets file.
*
* @example
* var BemhtmlTech = require('enb-bemhtml/techs/bemhtml'),
Expand Down
6 changes: 3 additions & 3 deletions techs/keysets-xml.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ var EOL = require('os').EOL,
* @augments {BaseTech}
* @classdesc
*
* Builds `?.keysets.{lang}.xml` from `?.keysets.{lang}.js` bundle files<br/><br/>
* Builds `?.keysets.{lang}.xml` from `?.keysets.{lang}.js` bundle files.<br/><br/>
*
* @param {Object} options Options.
* @param {String} [options.target='?.keysets.{lang}.xml'] Path to target with compiled file.
* @param {String} [options.target='?.keysets.{lang}.xml'] Path to a target with compiled file.
* @param {String} options.lang Language identifier.
* @param {String} [options.keysetsTarget='?.keysets.{lang}.js'] Path to source keysets file.
* @param {String} [options.keysetsTarget='?.keysets.{lang}.js'] Path to a source keysets file.
*
* @example
* var BemhtmlTech = require('enb-bemhtml/techs/bemhtml'),
Expand Down
4 changes: 2 additions & 2 deletions techs/keysets.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ var path = require('path'),
* @augments {BaseTech}
* @classdesc
*
* Collects and merges `?.keysets.{lang}.js` files based on files from `*.i18n` folders for given languages<br/><br/>
* Collects and merges `?.keysets.{lang}.js` files based on files from `*.i18n` folders for given languages.<br/><br/>
*
* @param {Object} options Options.
* @param {String} [options.target='?.keysets.{lang}.js'] Path to target with compiled file.
* @param {String} [options.target='?.keysets.{lang}.js'] Path to a target with compiled file.
* @param {String} options.lang Language identifier.
*
* @example
Expand Down
10 changes: 5 additions & 5 deletions techs/xjst/bemhtml-i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ var EOL = require('os').EOL,
* Localization is based on pre-built `?.keysets.{lang}.js` bundle files.<br/><br/>
*
* @param {Object} options Options.
* @param {String} [options.target='?.bemhtml.{lang}.js'] Path to target with compiled file.
* @param {String} [options.target='?.bemhtml.{lang}.js'] Path to a target with compiled file.
* @param {String} options.lang Language identifier.
* @param {String} [options.filesTarget='?.files'] Path to target with FileList.
* @param {String} [options.exportName='BEMHTML'] Name of BEMHTML template variable.
* @param {String} [options.applyFuncName='apply'] Alias for `apply` function of base BEMHTML template.
* @param {Boolean} [options.devMode=true] Set `devMode` option for convenient debugging.
* @param {Boolean} [options.devMode=true] Sets `devMode` option for convenient debugging.
* If `devMode` is set to true, code of templates
* will not be compiled but only wrapped for development
* purposes.
* @param {Boolean} [options.cache=false] Set `cache` option for cache usage.
* @param {Boolean} [options.cache=false] Sets `cache` option for cache usage.
* @param {Object} [options.requires] Names of dependencies which should be available from
* code of templates.
* @param {String[]} [options.sourceSuffixes] Files with specified suffixes involved in the
* assembly.
* @param {String} [options.keysetsFile='?.keysets.{lang}.js'] Path to source keysets file.
* @param {String} [options.keysetsFile='?.keysets.{lang}.js'] Path to a source keysets file.
*
* @example
* var BemhtmlI18nTech = require('enb-bem-i18n/techs/xjst/bemhtml-i18n'),
Expand All @@ -47,7 +47,7 @@ var EOL = require('os').EOL,
* bem.files
* ]);
*
* // collect and merge keysets files into bundle
* // collect and merge keysets files into a bundle
* node.addTechs([
* [ Keysets, { lang: '{lang}' } ]
* ]);
Expand Down
4 changes: 2 additions & 2 deletions test/lib/job-queue-stub.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var JobQueueStub = require('mock-enb/lib/job-queue-stub');

// Использование mock-fs не позволяет подключить xjst-processor в рантайме
// Usage of mock-fs does not allow to require XJST processor in runtime mode
// https://github.com/tschaub/mock-fs/issues/12
// по-этому подключаем его перед инициализацией mock-fs
// So it needs to be require before mock-fs
JobQueueStub.prototype.processor = require('enb-xjst/lib/xjst-processor');

0 comments on commit 2d25431

Please sign in to comment.