Permalink
Browse files

Upgraded to Grunt 0.4

  • Loading branch information...
1 parent e5529e3 commit a3c3cd454121ce8040fa31e3f7b6e69be766cf25 Parashuram committed Feb 26, 2013
Showing with 93 additions and 169 deletions.
  1. +4 −2 .travis.yml
  2. +46 −44 grunt.js → Gruntfile.js
  3. +5 −2 dist/IndexedDBShim.js
  4. +1 −93 dist/IndexedDBShim.min.js
  5. +37 −28 package.json
View
@@ -1,9 +1,11 @@
language: node_js
+before_script:
+ - npm install -g grunt-cli
node_js:
- - 0.6
+ - 0.8
notifications:
email: false
env:
global:
- secure: "JN2jbgXHrJN63viTp8pJidjvFvVMrwnyfvKpde3pYMs3zf2E0+cyjeTaKoJU\nrOqIQ/AmmjvYQAoQCtlc1HaPB2DFV0SKx8tiYxXWDgzMAmIlTNJftpXl2UWO\n23NBeW65+0V0WChZmBVacerX5rPVAdC48fJC2jPUoQwlgnCOQSs="
- - secure: "Aq9QMDB6t51fhShafCJczziEoTqT04C2PCE5L8kTYX/b+6E3zsEOYDCT/ozD\nlk8W0XolrRmguhAC1l8QmJvIrUifuDbOpHnGj/diX96MSA4zVOZXqkIBUlj0\ncjUyk8EqNl5f9qLje77ndIcIeYpJXGTu46AJgSYl1sndMTdT72Y="
+ - secure: "Aq9QMDB6t51fhShafCJczziEoTqT04C2PCE5L8kTYX/b+6E3zsEOYDCT/ozD\nlk8W0XolrRmguhAC1l8QmJvIrUifuDbOpHnGj/diX96MSA4zVOZXqkIBUlj0\ncjUyk8EqNl5f9qLje77ndIcIeYpJXGTu46AJgSYl1sndMTdT72Y="
View
@@ -1,46 +1,46 @@
/* global module:false */
-module.exports = function(grunt){
+module.exports = function(grunt) {
var srcFiles = ['src/Init.js', 'src/util.js', 'src/Sca.js', 'src/Key.js', 'src/Event.js', 'src/IDBRequest.js', 'src/IDBKeyRange.js', 'src/IDBCursor.js', 'src/IDBIndex.js', 'src/IDBObjectStore.js', 'src/IDBTransaction.js', 'src/IDBDatabase.js', 'src/shimIndexedDB.js', 'src/globalVars.js'];
// Project configuration.
var saucekey = null;
if (typeof process.env.saucekey !== "undefined") {
saucekey = process.env.saucekey;
}
grunt.initConfig({
- pkg: '<json:package.json>',
- meta: {
- banner: '/*! <%= pkg.name %> */'
- },
- lint: {
+ jshint: {
files: ['grunt.js', 'src/**/*.js', 'test/**/*.js']
},
concat: {
dist: {
src: srcFiles,
- dest: 'dist/<%= pkg.name %>.js'
+ dest: 'dist/IndexedDBShim.js'
+ }
+ },
+ uglify: {
+ all: {
+ src: srcFiles,
+ dest: 'dist/IndexedDBShim.min.js'
}
},
'jsmin-sourcemap': {
all: {
src: srcFiles,
- dest: 'dist/<%= pkg.name %>.min.js',
+ dest: 'dist/IndexedDBShim.min.js',
srcRoot: '..'
}
},
- watch: {
- files: '<config:lint.files>',
- tasks: 'lint test'
- },
-
- server: {
- base: '.',
- port: 9999
+ connect: {
+ server: {
+ options: {
+ base: '.',
+ port: 9999
+ }
+ }
},
-
qunit: {
all: ['http://localhost:9999/test/index.html']
},
-
+
'saucelabs-qunit': {
all: {
username: 'indexeddbshim',
@@ -57,21 +57,21 @@ module.exports = function(grunt){
}]
}
},
-
+
jshint: {
options: {
camelcase: true,
nonew: true,
- curly: true,// require { }
- eqeqeq: true,// === instead of ==
- immed: true,// wrap IIFE in parentheses
- latedef: true,// variable declared before usage
- newcap: true,// capitalize class names
- undef: true,// checks for undefined variables
+ curly: true, // require { }
+ eqeqeq: true, // === instead of ==
+ immed: true, // wrap IIFE in parentheses
+ latedef: true, // variable declared before usage
+ newcap: true, // capitalize class names
+ undef: true, // checks for undefined variables
regexp: true,
evil: true,
- eqnull: true,// == allowed for undefined/null checking
- expr: true,// allow foo && foo()
+ eqnull: true, // == allowed for undefined/null checking
+ expr: true, // allow foo && foo()
browser: true
// browser environment
},
@@ -84,7 +84,7 @@ module.exports = function(grunt){
idbModules: true,
logger: true,
require: true,
-
+
// Tests.
_: true,
asyncTest: true,
@@ -106,21 +106,23 @@ module.exports = function(grunt){
unescape: true,
process: true
}
- },
- uglify: {}
+ }
});
-
- // Default task.
+
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-contrib-uglify');
+ grunt.loadNpmTasks('grunt-contrib-connect');
+ grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-jsmin-sourcemap');
grunt.loadNpmTasks('grunt-saucelabs');
- grunt.registerTask('build', 'lint concat jsmin-sourcemap');
-
-
- grunt.registerTask("publish", function(){
+ grunt.registerTask('build', ['jshint', 'concat', 'uglify']);
+
+
+ grunt.registerTask("publish", function() {
var done = this.async();
console.log("Running publish action");
var request = require("request");
- request("https://api.travis-ci.org/repos/axemclion/IndexedDBShim/builds.json", function(err, res, body){
+ request("https://api.travis-ci.org/repos/axemclion/IndexedDBShim/builds.json", function(err, res, body) {
var commit = JSON.parse(body)[0];
var commitMessage = ["Commit from Travis Build #", commit.number, "\nBuild - https://travis-ci.org/axemclion/IndexedDBShim/builds/", commit.id, "\nBranch : ", commit.branch, "@ ", commit.commit];
console.log("Got Travis Build details");
@@ -132,23 +134,23 @@ module.exports = function(grunt){
"head": "master",
"commit_message": commitMessage.join("")
})
- }, function(err, response, body){
+ }, function(err, response, body) {
console.log(body);
done(!err);
});
});
});
-
- var testJobs = ["build", "server"];
+
+ var testJobs = ["build", "connect"];
if (saucekey !== null) {
testJobs.push("saucelabs-qunit");
}
-
+
if (process.env.CI && process.env.TRAVIS) {
testJobs.push("publish");
}
testJobs.push("publish");
- grunt.registerTask('test', testJobs.join(" "));
-
+ grunt.registerTask('test', testJobs);
+
grunt.registerTask('default', 'build');
-};
+};
View
@@ -847,10 +847,10 @@ var idbModules = {};
else
if (typeof mode === "string") {
switch (mode) {
- case "readonly":
+ case "readwrite":
this.mode = READ_WRITE;
break;
- case "readwrite":
+ case "readonly":
this.mode = READ;
break;
default:
@@ -1258,6 +1258,9 @@ var idbModules = {};
window.IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction;
window.IDBCursor = window.IDBCursor || window.webkitIDBCursor;
window.IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange;
+ if(!window.IDBTransaction){
+ window.IDBTransaction = {};
+ }
window.IDBTransaction.READ_ONLY = window.IDBTransaction.READ_ONLY || "readonly";
window.IDBTransaction.READ_WRITE = window.IDBTransaction.READ_WRITE || "readwrite";
}
Oops, something went wrong.

0 comments on commit a3c3cd4

Please sign in to comment.