Skip to content

Commit

Permalink
Version 0.2.0 with singletons and db connection fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackson Gariety committed Feb 22, 2014
1 parent f7d84ae commit 60f60fa
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
8 changes: 3 additions & 5 deletions Gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Modules
var gulp = require('gulp')
, mocha = require('gulp-mocha')
, nodemon = require('gulp-nodemon')

/**
* LINT WITH JSHINT
Expand All @@ -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' }))
})
Expand All @@ -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')
})

Expand Down
4 changes: 2 additions & 2 deletions examples/mustache-example/controllers/todo.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/mustache-example/models/todo.js
Original file line number Diff line number Diff line change
@@ -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
})
Expand Down
4 changes: 2 additions & 2 deletions examples/mustache-example/views/about.js
Original file line number Diff line number Diff line change
@@ -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.')
}
Expand Down
8 changes: 4 additions & 4 deletions examples/mustache-example/views/todo.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sara",
"version": "0.1.0",
"version": "0.2.0",
"main": "./lib/sara.js",
"dependencies": {
"connect": "2.12.0",
Expand Down

0 comments on commit 60f60fa

Please sign in to comment.