Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update generator to use latest yo deps. Fixes #16 closes #15

  • Loading branch information...
commit 5af38215c355dc6530a6bb1f6d358086ff16bc7e 1 parent 962702b
@thanpolas authored
View
1  .gitignore
@@ -7,3 +7,4 @@ app/components
closure-library
templates/package.json
npm-debug.log
+test/temp
View
7 .jshintrc
@@ -78,6 +78,11 @@
"app",
"ssd",
"appOne",
- "when"
+ "when",
+ "it",
+ "test",
+ "describe",
+ "beforeEach",
+ "before"
]
}
View
8 app/base.js
@@ -2,13 +2,13 @@
* The base library every generator in this repo extends
*
*/
-require('colorplus').enable();
+require('colors');
var generator = require('yeoman-generator');
var util = require('util');
var path = require('path');
-var Generator = module.exports = function Generator() {
+var Generator = module.exports = function Generator(args, options, config) {
generator.Base.apply(this, arguments);
// this.option('flag', { desc: 'Desc for flag', ...})
@@ -20,7 +20,6 @@ var Generator = module.exports = function Generator() {
this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json')));
this.on('end', Generator._onEnd.bind(this));
-
};
util.inherits(Generator, generator.Base);
@@ -31,6 +30,9 @@ Generator._onEnd = function () {
return '\n\n' + step.inverse.green + ' ' + descr.bold.green + '\n';
}
+ // this.installDependencies({ skipInstall: options['skip-install'] });
+
+
var allDone = '\n\n';
allDone += ' ___ ____ __ __\n';
allDone += ' / | / / / ____/ /___ ____ ___ / /\n';
View
6 app/index.js
@@ -7,7 +7,7 @@ var util = require('util');
// Documentation: https://github.com/yeoman/generator/wiki/base
-var Generator = module.exports = function Generator() {
+var Generator = module.exports = function Generator(args, options, config) {
BaseGenerator.apply(this, arguments);
this.closure.web = true;
@@ -17,12 +17,10 @@ var Generator = module.exports = function Generator() {
this.closure.closurePath = 'app/';
this.closure.closureLinterPath = 'app/';
this.closure.distPath = 'app/jsc';
-
};
util.inherits(Generator, BaseGenerator);
-Generator.prototype.scaffold = function scaffold() {
-
+Generator.prototype.app = function app() {
// do plain copy operations
this.directory('app');
this.directory('build');
View
6 package.json
@@ -32,10 +32,8 @@
"url": "git://github.com/closureplease/generator-closure.git"
},
"dependencies": {
- "yeoman-generator": "~0.10.2",
- "colorplus": "~0.2.4",
- "color": "~0.4.2",
- "colors": "~0.6.0-1"
+ "colors": "~0.6.2",
+ "yeoman-generator": "~0.13.4"
},
"devDependencies": {
"grunt": "~0.4.1",
View
56 test/test.js
@@ -3,39 +3,67 @@
var path = require('path');
var helpers = require('yeoman-generator').test;
+var gen = null;
-describe('Webapp generator test', function () {
+
+
+
+describe('closure generator', function () {
beforeEach(function (done) {
helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
if (err) {
return done(err);
}
- this.webapp = helpers.createGenerator('closure', [
- '../../app', [
- helpers.createDummyGenerator()
- ]
+ this.app = helpers.createGenerator('closure:app', [
+ '../../app'
]);
done();
}.bind(this));
});
- it('the generator can be required without throwing', function () {
- // not testing the actual run of generators yet
- this.app = require('../app');
- });
-
it('creates expected files', function (done) {
var expected = [
- ['component.json', /"name": "temp"/],
- ['package.json', /"name": "temp"/],
+ // add files you expect to exist here.
+ '.jshintrc',
+ '.editorconfig',
+ 'bower.json',
+ 'package.json',
'Gruntfile.js',
- 'app/index.html'
+ 'app/index.html',
];
- this.webapp.run({}, function () {
+ this.app.options['skip-install'] = true;
+ this.app.run({}, function () {
helpers.assertFiles(expected);
done();
});
});
});
+
+// describe('Webapp generator test', function () {
+// before(helpers.before(path.join(__dirname, './temp')));
+
+// it('the generator can be required without throwing', function () {
+// // not testing the actual run of generators yet
+// this.app = require('../app');
+// });
+
+// it('runs sucessfully', function(done) {
+// helpers.runGenerator('closure', done);
+// });
+
+// it('creates expected files', function (done) {
+// var expected = [
+// ['component.json', /"name": "temp"/],
+// ['package.json', /"name": "temp"/],
+// 'Gruntfile.js',
+// 'app/index.html'
+// ];
+
+// gen.run({}, function () {
+// helpers.assertFiles(expected);
+// done();
+// });
+// });
+// });
Please sign in to comment.
Something went wrong with that request. Please try again.