Permalink
Browse files

begin moving automation to grunt

  • Loading branch information...
1 parent 6c17fc4 commit 2fcc3a4063990bedbce0199b7fc84cc342c56aef @semmypurewal committed Mar 13, 2013
Showing with 70 additions and 53 deletions.
  1. +2 −1 .gitignore
  2. +51 −0 Gruntfile.js
  3. +1 −12 build/jermaine-min.js
  4. +6 −40 build/jermaine.js
  5. +10 −0 package.json
View
@@ -1,2 +1,3 @@
*~
-cache.properties
+cache.properties
+node_modules
View
@@ -0,0 +1,51 @@
+module.exports = function (grunt) {
+ var sources, libraries;
+
+ sources = [
+ "util/namespace.js",
+ "util/event_emitter.js",
+ "core/validator.js",
+ "core/attr.js",
+ "core/attr_list.js",
+ "core/method.js",
+ "core/model.js"
+ ];
+
+ grunt.initConfig({
+ pkg: grunt.file.readJSON("package.json"),
+
+ jshint: {
+ options: {
+ browser: true
+ },
+ all: ["Gruntfile.js", "src/**/*.js"]
+ },
+
+ concat: {
+ options: {
+ separator: ";"
+ },
+ source: {
+ src: sources.map( function (source) {
+ return "src/" + source;
+ }),
+ dest: "build/jermaine.js"
+ }
+ },
+
+
+ uglify: {
+ minify: {
+ files: {
+ "build/jermaine-min.js": ["build/jermaine.js"]
+ }
+ }
+ }
+ });
+
+ grunt.loadNpmTasks("grunt-contrib-jshint");
+ grunt.loadNpmTasks("grunt-contrib-concat");
+ grunt.loadNpmTasks("grunt-contrib-uglify");
+
+ grunt.registerTask("default", ["jshint", "concat", "uglify"]);
+};
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,35 +1,3 @@
-if (!Array.prototype.indexOf) {
- Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {
- "use strict";
- if (this == null) {
- throw new TypeError();
- }
- var t = Object(this);
- var len = t.length >>> 0;
- if (len === 0) {
- return -1;
- }
- var n = 0;
- if (arguments.length > 0) {
- n = Number(arguments[1]);
- if (n != n) { // shortcut for verifying if it's NaN
- n = 0;
- } else if (n != 0 && n != Infinity && n != -Infinity) {
- n = (n > 0 || -1) * Math.floor(Math.abs(n));
- }
- }
- if (n >= len) {
- return -1;
- }
- var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);
- for (; k < len; k++) {
- if (k in t && t[k] === searchElement) {
- return k;
- }
- }
- return -1;
- }
-}
/*global describe, it, beforeEach, expect, xit, jasmine */
(function (ns) {
@@ -105,8 +73,7 @@ if (!Array.prototype.indexOf) {
return namespace(ns, function (exports) {
exports.namespace = namespace;
});
-}("window.jermaine.util"));
-window.jermaine.util.namespace("window.jermaine.util", function (ns) {
+}("window.jermaine.util"));;window.jermaine.util.namespace("window.jermaine.util", function (ns) {
"use strict";
var EventEmitter = function () {
var that = this,
@@ -215,7 +182,7 @@ window.jermaine.util.namespace("window.jermaine.util", function (ns) {
ns.EventEmitter = EventEmitter;
});
-window.jermaine.util.namespace("window.jermaine", function (ns) {
+;window.jermaine.util.namespace("window.jermaine", function (ns) {
"use strict";
var that = this,
Validator,
@@ -330,7 +297,7 @@ window.jermaine.util.namespace("window.jermaine", function (ns) {
ns.Validator = Validator;
});
-/**
+;/**
* Attr
*
* Creates an encapsulated, chainable attribute that are validated by
@@ -688,7 +655,7 @@ window.jermaine.util.namespace("window.jermaine", function (ns) {
// export Attr to the specified namespace
ns.Attr = Attr;
});
-window.jermaine.util.namespace("window.jermaine", function (ns) {
+;window.jermaine.util.namespace("window.jermaine", function (ns) {
"use strict";
function AttrList(name) {
@@ -824,7 +791,7 @@ window.jermaine.util.namespace("window.jermaine", function (ns) {
ns.AttrList = AttrList;
});
-window.jermaine.util.namespace("window.jermaine", function (ns) {
+;window.jermaine.util.namespace("window.jermaine", function (ns) {
"use strict";
var Method = function (name, method) {
@@ -843,8 +810,7 @@ window.jermaine.util.namespace("window.jermaine", function (ns) {
};
};
ns.Method = Method;
-});
-window.jermaine.util.namespace("window.jermaine", function (ns) {
+});;window.jermaine.util.namespace("window.jermaine", function (ns) {
"use strict";
var Model = function (specification) {
View
@@ -0,0 +1,10 @@
+{
+ "name": "jermaine",
+ "version": "0.1.0",
+ "devDependencies": {
+ "grunt": "~0.4.0",
+ "grunt-contrib-jshint": "~0.1.1",
+ "grunt-contrib-concat": "~0.1.3",
+ "grunt-contrib-uglify": "~0.1.2"
+ }
+}

0 comments on commit 2fcc3a4

Please sign in to comment.