Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

various updates to init tasks

  • Loading branch information...
commit da3d959a0e04a972c7269c1c768c87539d62a1d8 1 parent ffdd60e
@tbranyen tbranyen authored
View
9 bbb.js
@@ -7,9 +7,18 @@ exports.warnOn = "*";
exports.template = function(grunt, init, done) {
+ var _ = grunt.utils._;
+
// Files to copy (and process).
var files = init.filesToCopy({});
+ // Remove any git files
+ _.each(files, function(flag, file) {
+ if (file.indexOf(".git") === 0) {
+ delete files[file];
+ }
+ });
+
// Actually copy (and process). files.
init.copyAndProcess(files, {}, {
noProcess: [ "assets/**", "test/**", "favicon.ico" ]
View
3  bbb/rename.json
@@ -1,3 +0,0 @@
-{
- ".git": false
-}
View
1  bbb/root
1  bbb/root
@@ -1 +0,0 @@
-Subproject commit 10a6cd7144d7bba5a16a9010961a6bda4624028c
View
25 module.js
@@ -3,23 +3,30 @@ exports.notes = "Generates a new module";
exports.template = function(grunt, init, done) {
- grunt.helper("prompt", {}, [
+ var _ = grunt.utils._;
- // Get the name of the module.
- grunt.helper("prompt_for", "name", function(value, data, done) {
- // Flatten the module name.
- value = value.toLowerCase();
+ _.extend(grunt.helper("prompt_for_obj"), {
+ name: {
+ message: "Module Name",
+ validator: /^[\w\-\.]+$/
+ }
+ });
- // Set the module name to be the title case.
- data.module_name = value[0].toUpperCase() + value.slice(1);
+ grunt.helper("prompt", {}, [
- done(null, value);
- }),
+ // Get the name of the module.
+ grunt.helper("prompt_for", "name")
], function(err, props) {
// Files to copy (and process).
var files = init.filesToCopy(props);
+ // Ensure the name is lowercase.
+ props.name = props.name.toLowerCase();
+
+ // Set the module name to be the title case.
+ props.module_name = props.name[0].toUpperCase() + props.name.slice(1);
+
// Actually copy (and process) files.
init.copyAndProcess(files, props, {});
View
2  todomvc/root/app/namespace.js → todomvc/root/app/app.js
@@ -28,7 +28,7 @@ function($, _, Backbone) {
});
}
- return done(JST[path]);
+ return JST[path];
}
});
View
2  todomvc/root/app/config.js
@@ -17,7 +17,7 @@ require.config({
shim: {
backbone: {
deps: ["lodash", "jquery"],
- attach: "Backbone"
+ exports: "Backbone"
},
// Add the Backbone LocalStorage plugin in
View
7 todomvc/root/app/main.js
@@ -1,5 +1,5 @@
require([
- "namespace",
+ "app",
// Libs
"jquery",
@@ -9,7 +9,7 @@ require([
"modules/todo"
],
-function(namespace, $, Backbone, Todo) {
+function(app, $, Backbone, Todo) {
// An example Backbone application contributed by
// [Jérôme Gravel-Niquet](http://jgn.me/). This demo uses a simple
@@ -61,9 +61,6 @@ function(namespace, $, Backbone, Todo) {
}
});
- // Shorthand the application namespace
- var app = namespace.app;
-
// Treat the jQuery ready function as the entry point to the application.
// Inside this function, kick-off all initialization, everything up to this
// point should be definitions.
View
6 todomvc/root/app/modules/todo.js
@@ -1,5 +1,5 @@
define([
- "namespace",
+ "app",
// Libs
"backbone",
@@ -11,10 +11,10 @@ define([
"plugins/backbone-localstorage"
],
-function(namespace, Backbone, Views) {
+function(app, Backbone, Views) {
// Create a new module
- var Todo = namespace.module();
+ var Todo = app.module();
// Todo Model
// ----------
View
4 todomvc/root/app/modules/todo/views.js
@@ -1,11 +1,11 @@
define([
- "namespace",
+ "app",
// Libs
"backbone"
],
-function(namespace, Backbone) {
+function(app, Backbone) {
var Views = {};
Please sign in to comment.
Something went wrong with that request. Please try again.