diff --git a/Gulpfile.js b/Gulpfile.js index a3b847b..296e5af 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -1,5 +1,7 @@ // Modules var gulp = require('gulp') + , mocha = require('gulp-mocha') + , nodemon = require('gulp-nodemon') /** * LINT WITH JSHINT @@ -26,8 +28,6 @@ gulp.task('lint', function() { * TEST WITH MOCHA */ gulp.task('test', function () { - var mocha = require('gulp-mocha') - gulp.src('test/*-test.js') .pipe(mocha({ ui: 'bdd' })) }) @@ -36,9 +36,7 @@ gulp.task('test', function () { * RUN WITH NODEMON */ gulp.task('develop', function () { - var nodemon = require('gulp-nodemon') - - nodemon({ script: './examples/mustache-example/app', options: '-e html,js' }) + nodemon({ script: './examples/mustache-example/app', ext: 'html js' }) .on('restart', 'lint') }) diff --git a/examples/mustache-example/controllers/todo.js b/examples/mustache-example/controllers/todo.js index e2faa85..0b38fe6 100644 --- a/examples/mustache-example/controllers/todo.js +++ b/examples/mustache-example/controllers/todo.js @@ -1,9 +1,9 @@ -var Sara = require('sara') +var App = require('sara') , Todo = require('../models/todo') global.Todo = Todo -var TodoController = module.exports = new Sara.Controller() +var TodoController = module.exports = new App.Controller() /** * CREATE diff --git a/examples/mustache-example/models/todo.js b/examples/mustache-example/models/todo.js index dfcf34d..0a25dc4 100644 --- a/examples/mustache-example/models/todo.js +++ b/examples/mustache-example/models/todo.js @@ -1,6 +1,6 @@ -var Sara = require('sara') +var App = require('sara') -var Todo = module.exports = new Sara.Model('Todo', { +var Todo = module.exports = new App.Model('Todo', { title: '' , completed: false }) diff --git a/examples/mustache-example/views/about.js b/examples/mustache-example/views/about.js index 4539799..a62209b 100644 --- a/examples/mustache-example/views/about.js +++ b/examples/mustache-example/views/about.js @@ -1,7 +1,7 @@ -var Sara = require('sara') +var App = require('sara') , $ = require('jquery') -var AboutView = module.exports = new Sara.View('Todo', { +var AboutView = module.exports = new App.View('Todo', { render: function (document) { $(document).find('main').html('About my app.') } diff --git a/examples/mustache-example/views/todo.js b/examples/mustache-example/views/todo.js index b5b0057..d4a6e45 100644 --- a/examples/mustache-example/views/todo.js +++ b/examples/mustache-example/views/todo.js @@ -1,14 +1,14 @@ -var Sara = require('sara') +var App = require('sara') , Mustache = require('mustache') , TodoController = require('../controllers/todo') , Todo = require('../models/todo') , $ = require('jquery') -var TodoView = module.exports = new Sara.View('Todo', { - template: Sara.template('todo', '../templates/todo.html') +var TodoView = module.exports = new App.View('Todo', { + template: App.template('todo', '../templates/todo.html').toString() , render: function (document) { function render() { - $(document).find('main').html(Mustache.render(this.template.toString(), { todos: Todo.all(), completed: Todo.completed() })) + $(document).find('main').html(Mustache.render(this.template, { todos: Todo.all(), completed: Todo.completed() })) with (TodoController) { $(document).find('div button').click(clear) diff --git a/package.json b/package.json index d5ff4fb..a61bad1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sara", - "version": "0.1.0", + "version": "0.2.0", "main": "./lib/sara.js", "dependencies": { "connect": "2.12.0",