diff --git a/package.json b/package.json index c6f59c3..2f39c80 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "action", - "version": "0.4.4", - "releaseName": "Akshay Kumar", + "version": "0.5.0", + "releaseName": "Angelina Jolie", "private": true, "scripts": { "start": "node app.js" @@ -11,14 +11,21 @@ "ejs": "*" }, "devDependencies": { + "chai": "^1.9.1", "gulp": "^3.6.0", "gulp-concat": "^2.2.0", "gulp-header": "^1.0.2", "gulp-jshint": "^1.5.5", + "gulp-karma": "0.0.4", + "gulp-mocha": "^1.1.0", "gulp-plumber": "^0.6.0", "gulp-rename": "^1.2.0", "gulp-uglify": "^0.2.1", "gulp-watch": "^0.5.4", - "gulp-zip": "^0.3.4" + "gulp-zip": "^0.3.4", + "karma": "^0.12.23", + "karma-chai": "^0.1.0", + "karma-mocha": "^0.1.9", + "mocha": "^1.21.4" } } diff --git a/public/javascripts/action.js b/public/javascripts/action.js index 8d265da..8ae9459 100644 --- a/public/javascripts/action.js +++ b/public/javascripts/action.js @@ -1,6 +1,6 @@ //TODO routing and pushstate // view rendering on routing events -(function(exports){ +(function(){ 'use strict'; var action = { @@ -751,5 +751,11 @@ }); //return the tweaked function - exports = action; -})(typeof exports === 'undefined' ? this['action'] = {} : exports); + if (typeof module !== 'undefined') { + // node environment it seems... module.exports this + module.exports = action; + } else { + //looks like a browser put it in the window scope + window.action = action; + } +})(); diff --git a/routes/index.js b/routes/index.js index e9bbf9e..b618172 100644 --- a/routes/index.js +++ b/routes/index.js @@ -2,6 +2,7 @@ /* * GET home page. */ +var action = require('../public/javascripts/action.js'); exports.index = function(req, res){ res.render('index', { title: 'Action! Framework' });