Skip to content
This repository has been archived by the owner on Jul 4, 2021. It is now read-only.

Commit

Permalink
Use grunt built in template processing rather than homebrew task
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Mar 22, 2013
1 parent de9c8e9 commit 51c06eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
13 changes: 3 additions & 10 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ module.exports = function(grunt) {
},
concat: {
options: {
banner: '<%= meta.banner %>'
banner: '<%= meta.banner %>',
process: true
},
dist: {
src: 'lib/<%= pkg.name %>.js',
Expand Down Expand Up @@ -68,15 +69,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-mocha');

// Default task.
grunt.registerTask('default', ['test', 'concat', 'replace-version', 'uglify']);
grunt.registerTask('default', ['test', 'concat', 'uglify']);
grunt.registerTask('test', ['jshint', 'mocha']);


grunt.registerTask('replace-version', 'replace the version placeholder in backbone.paginator.js', function() {
var pkg = grunt.config.get('pkg');
var filename = 'dist/' + pkg.name + '.js';
var content = grunt.file.read(filename);
var rendered = grunt.template.process(content, { pkg : pkg });
grunt.file.write(filename, rendered);
});
};
2 changes: 1 addition & 1 deletion test/test-1.0.0.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</script>

<!-- Include anything you want to test -->
<script src="../lib/backbone.paginator.js" type="text/javascript" charset="utf-8"></script>
<script src="../dist/backbone.paginator.js" type="text/javascript" charset="utf-8"></script>

<!-- Spec files -->
<script src="backbone.paginator.requestPager_test.js"></script>
Expand Down

0 comments on commit 51c06eb

Please sign in to comment.