Skip to content

Commit

Permalink
Add grunt-neuter for managing multiple files. This also fixes #27 and c…
Browse files Browse the repository at this point in the history
…loses #15
  • Loading branch information
fayimora committed May 21, 2013
1 parent edeeca0 commit 634b2f3
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 23 deletions.
6 changes: 2 additions & 4 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,8 @@ EmberGenerator.prototype.writeIndex = function writeIndex() {

this.indexFile = this.appendScripts(this.indexFile, 'scripts/components.js', this.bowerScripts);

this.indexFile = this.appendFiles(this.indexFile, 'js', 'scripts/main.js', [
'scripts/app.js',
'scripts/compiled-templates.js'
], null, ['app', '.tmp']);
this.indexFile = this.appendFiles(this.indexFile, 'js', 'scripts/templates.js', ['scripts/compiled-templates.js'], null, ['.tmp']);
this.indexFile = this.appendFiles(this.indexFile, 'js', 'scripts/main.js', ['scripts/combined-scripts.js'], null, ['.tmp']);
};

EmberGenerator.prototype.bootstrapJavaScript = function bootstrapJavaScript() {
Expand Down
19 changes: 15 additions & 4 deletions app/templates/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,14 @@ module.exports = function (grunt) {
files: ['<%%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
tasks: ['compass:server']
},
neuter: {
files: ['<%%= yeoman.app %>/scripts/{,*/}*.js'],
tasks: ['neuter', 'livereload']
},
livereload: {
files: [
'<%%= yeoman.app %>/*.html',
'{.tmp,<%%= yeoman.app %>}/styles/{,*/}*.css',
'{.tmp,<%%= yeoman.app %>}/scripts/{,*/}*.js',
'<%%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
],
tasks: ['livereload']
Expand Down Expand Up @@ -277,16 +280,19 @@ module.exports = function (grunt) {
server: [
'ember_templates',
'coffee:dist',
'compass:server'
'compass:server',
'neuter:app'
],
test: [
'coffee',
'compass'
'compass',
'neuter:app'
],
dist: [
'ember_templates',
'coffee',
'compass:dist',
'neuter:app',
'imagemin',
'svgmin',
'htmlmin'
Expand All @@ -304,8 +310,13 @@ module.exports = function (grunt) {
'.tmp/scripts/compiled-templates.js': '<%%= yeoman.app %>/templates/{,*/}*.hbs'
}
}
},
neuter: {
app: {
src: '<%%= yeoman.app %>/scripts/app.js',
dest: '.tmp/scripts/combined-scripts.js'
}
}

});

grunt.renameTask('regarde', 'watch');
Expand Down
3 changes: 2 additions & 1 deletion app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"grunt-svgmin": "~0.1.0",
"grunt-concurrent": "~0.1.0",
"matchdep": "~0.1.1",
"grunt-ember-templates": "0.4.5"
"grunt-ember-templates": "0.4.5",
"grunt-neuter": "0.5.0"
},
"engines": {
"node": ">=0.8.0"
Expand Down
2 changes: 1 addition & 1 deletion app/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<title>Ember Starter Kit</title>
<title>Yeoman Ember Starter Kit</title>
</head>
<body>

Expand Down
30 changes: 17 additions & 13 deletions app/templates/scripts/app.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
/*global Ember */

(function (window) {
var App = window.App = Ember.Application.create();

App.Router.map(function () {
// put your routes here
});

App.IndexRoute = Ember.Route.extend({
model: function () {
return ['red', 'yellow', 'blue'];
}
});
})(this);
var App = window.App = Ember.Application.create();

/* Order and include as you please. */
// require('app/scripts/routes/*');
// require('app/scripts/controllers/*');
// require('app/scripts/models/*');
// require('app/scripts/views/*');

App.Router.map(function () {
// put your routes here
});

App.IndexRoute = Ember.Route.extend({
model: function () {
return ['red', 'yellow', 'blue'];
}
});

0 comments on commit 634b2f3

Please sign in to comment.