From d81dffda1a776a82ae6ecc1a46c2d4fde4226f28 Mon Sep 17 00:00:00 2001 From: Adam Bloom Date: Fri, 23 Oct 2015 17:04:42 -0700 Subject: [PATCH 1/3] Added option for using a namespace in the standard runner --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 4234852..5a23b8d 100644 --- a/index.js +++ b/index.js @@ -46,7 +46,9 @@ function ngConstantPlugin(opts) { try { var data = file.isNull() ? {} : yaml.safeLoad(file.contents); - + + data = options.namespace ? data[options.namespace] : data; + // Create the module string var result = _.template(template)({ moduleName: getModuleName(data, options, file), From 385248acf5d4c40c1ca2185c132802081e2043cc Mon Sep 17 00:00:00 2001 From: Adam Bloom Date: Tue, 27 Oct 2015 16:50:43 -0700 Subject: [PATCH 2/3] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 81986ce..e0a26a7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gulp-ng-constant", - "version": "1.1.0", + "version": "1.1.1", "description": "Gulp plugin for dynamic generation of angular constant modules.", "main": "index.js", "repository": { From ae607e76840619ee0c8f6532b57f83c3acc12d73 Mon Sep 17 00:00:00 2001 From: Adam Bloom Date: Tue, 27 Oct 2015 16:53:24 -0700 Subject: [PATCH 3/3] Update README.md --- README.md | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/README.md b/README.md index 6a09ccd..3835c54 100644 --- a/README.md +++ b/README.md @@ -225,33 +225,6 @@ Location of a custom template file for creating the output configuration file. D ## Examples -### Multiple Environments - -_**config.json**_ -```json -{ - "development": { "greeting": "Sup!" }, - "production": { "greeting": "Hello" } -} -``` - -_**gulpfile.js**_ -```javascript -var gulp = require('gulp'); -var ngConstant = require('gulp-ng-constant'); - -gulp.task('constants', function () { - var myConfig = require('./config.json'); - var envConfig = myConfig[process.env]; - return ngConstant({ - constants: envConfig, - stream: true - }) - .pipe(gulp.dest('dist')); -}); - -``` - ### Stream ```javascript