Skip to content

Commit

Permalink
Implement Dexter.timer
Browse files Browse the repository at this point in the history
Also Convert all spaces into tabs and fix Dexter Indent

Closes #16
  • Loading branch information
luanmuniz authored and leobalter committed Sep 29, 2014
1 parent 9c0bd5e commit debd8d8
Show file tree
Hide file tree
Showing 19 changed files with 2,376 additions and 1,844 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Expand Up @@ -9,7 +9,7 @@ root = true

# Change these settings to your own preference
indent_style = tab
indent_size = 1
indent_size = 4

# We recommend you to keep these unchanged
end_of_line = lf
Expand Down
4 changes: 3 additions & 1 deletion .jshintrc
Expand Up @@ -23,6 +23,8 @@
"ActiveXObject": true,
"require": true,
"exports": true,
"define": true
"define": true,
"setTimeout": true,
"setInterval": true
}
}
247 changes: 122 additions & 125 deletions Gruntfile.js
@@ -1,134 +1,131 @@
module.exports = function( grunt ) {
'use strict';
'use strict';

// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON( 'package.json' ),
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' +
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
concat: {
options: {
banner: '<%= banner %>',
stripBanners: true
},
dist: {
dest: 'dist/<%= pkg.name %>.js',
src: [
'src/Dexter.js',
'src/Dexter.fakeXHR.js'
]
}
},
uglify: {
options: {
banner: '<%= banner %>',
codegen: { ascii_only: true },
sourceMap: true
},
dist: {
dest: 'dist/<%= pkg.name %>.min.js',
src: '<%= concat.dist.dest %>'
}
},
qunit: {
options: {
timeout: 30000,
'--web-security': 'no',
coverage: {
src: [ 'src/**/*.js' ],
instrumentedFiles: 'build/temp',
htmlReport: 'build/report/coverage',
lcovReport: 'build/report/lcov',
linesThresholdPct: 80
}
},
all: [ 'test/*.html' ]
},
qunitnode: {
all: [
'test/unit/environment.js',
'test/unit/spy.js',
'test/unit/fake.js',
'test/unit/restore.js'
]
},
coveralls: {
options: {
force: true
},
all: {
// LCOV coverage file relevant to every target
src: 'build/report/lcov/lcov.info'
}
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [ 'Gruntfile.js', 'src/**/*.js', 'test/**/*.js' ]
},
jscs: {
src: '<%= jshint.all %>',
options: {
preset: 'jquery'
}
},
mdoc: {
options: {
baseTitle: 'DexterJS',
indexContentPath: 'README.md'
},
docs: {
files: {
'docs/html': 'docs'
}
}
},
watch: {
code: {
files: [
'src/**/*.js',
'test/**/*.js'
],
tasks: 'lint qunit concat uglify'
},
docs: {
files: [
'<%= mdoc.src %>'
],
tasks: 'mdoc'
}
}
});
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON( 'package.json' ),
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' +
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
concat: {
options: {
banner: '<%= banner %>',
stripBanners: true
},
dist: {
dest: 'dist/<%= pkg.name %>.js',
src: [
'src/Dexter.js',
'src/Dexter.fakeXHR.js'
]
}
},
uglify: {
options: {
banner: '<%= banner %>',
codegen: { ascii_only: true },
sourceMap: true
},
dist: {
dest: 'dist/<%= pkg.name %>.min.js',
src: '<%= concat.dist.dest %>'
}
},
qunit: {
options: {
timeout: 30000,
'--web-security': 'no',
coverage: {
src: [ 'src/**/*.js' ],
instrumentedFiles: 'build/temp',
htmlReport: 'build/report/coverage',
lcovReport: 'build/report/lcov',
linesThresholdPct: 80
}
},
all: [ 'test/*.html' ]
},
qunitnode: {
all: [
'test/unit/environment.js',
'test/unit/spy.js',
'test/unit/fake.js',
'test/unit/timer.js',
'test/unit/restore.js'
]
},
coveralls: {
options: {
force: true
},
all: {
// LCOV coverage file relevant to every target
src: 'build/report/lcov/lcov.info'
}
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [ 'Gruntfile.js', 'src/**/*.js', 'test/**/*.js' ]
},
jscs: {
src: '<%= jshint.all %>',
options: {
preset: 'jquery'
}
},
mdoc: {
options: {
baseTitle: 'DexterJS',
indexContentPath: 'README.md'
},
docs: {
files: {
'docs/html': 'docs'
}
}
},
watch: {
options: {
atBegin: true
},
files: [
'Gruntfile.js',
'src/**/*.js',
'test/**/*.js'
],
tasks: 'default'
}
});

[
'grunt-contrib-concat',
'grunt-contrib-jshint',
'grunt-contrib-uglify',
'grunt-contrib-watch',
'grunt-coveralls',
'grunt-jscs-checker',
'grunt-qunitnode',
'grunt-qunit-istanbul'
].forEach( function( task ) {
grunt.loadNpmTasks( task );
});
[
'grunt-contrib-concat',
'grunt-contrib-jshint',
'grunt-contrib-uglify',
'grunt-contrib-watch',
'grunt-coveralls',
'grunt-jscs-checker',
'grunt-qunitnode',
'grunt-qunit-istanbul'
].forEach( function( task ) {
grunt.loadNpmTasks( task );
});

grunt.registerMultiTask( 'mdoc', function() {
var opts = this.options(),
mdoc = require( 'mdoc' );
grunt.registerMultiTask( 'mdoc', function() {
var opts = this.options(),
mdoc = require( 'mdoc' );

this.files.forEach( function( file ) {
opts.inputDir = file.src[ 0 ];
opts.outputDir = file.dest;
this.files.forEach( function( file ) {
opts.inputDir = file.src[ 0 ];
opts.outputDir = file.dest;

mdoc.run( opts );
});
});
mdoc.run( opts );
});
});

// Default task.
grunt.registerTask( 'default', 'jshint jscs qunit qunitnode concat uglify'.split( ' ' ) );
// Default task.
grunt.registerTask( 'default', 'jshint jscs qunit concat uglify'.split( ' ' ) );

};

0 comments on commit debd8d8

Please sign in to comment.