Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Commit

Permalink
Merge pull request #43 from thejameskyle/add-version-and-noconflict
Browse files Browse the repository at this point in the history
Add Wreqr.VERSION and Wreqr.noConflict
  • Loading branch information
samccone committed Apr 27, 2014
2 parents cd94db9 + 2615500 commit db96c8a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 14 deletions.
18 changes: 15 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,20 @@ module.exports = function(grunt) {

preprocess: {
core_build: {
files: {
'lib/backbone.wreqr.js' : 'src/wreqr.js'
src: 'src/wreqr.js',
dest: 'lib/backbone.wreqr.js'
}
},

template: {
options: {
data: {
version: '<%= meta.version %>'
}
},
core: {
src: '<%= preprocess.core_build.dest %>',
dest: '<%= preprocess.core_build.dest %>'
}
},

Expand Down Expand Up @@ -125,6 +136,7 @@ module.exports = function(grunt) {
});

grunt.loadNpmTasks('grunt-preprocess');
grunt.loadNpmTasks('grunt-template');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
Expand All @@ -140,6 +152,6 @@ module.exports = function(grunt) {
grunt.registerTask('server', ['jasmine:wreqr:build', 'connect:server', 'watch:server']);

// Default task.
grunt.registerTask('default', ['jshint', 'jasmine:coverage', 'preprocess', 'concat', 'uglify']);
grunt.registerTask('default', ['jshint', 'jasmine:coverage', 'preprocess', 'template', 'concat', 'uglify']);

};
16 changes: 5 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,29 @@
"decoupled",
"architecture"
],

"licenses": [
{
"type": "MIT",
"url": "https://github.com/marionettejs/backbone.wreqr/blob/master/LICENSE.md"
}
],

"scripts": {
"test" : "grunt jasmine",
"start" : "grunt jasmine-server"
"test": "grunt jasmine",
"start": "grunt jasmine-server"
},

"author": {
"name": "Derick Bailey",
"email": "[email protected]",
"web": "http://derickbailey.lostechies.com"
},

"bugs": {
"web": "https://github.com/marionettejs/backbone.wreqr/issues"
},

"repository": {
"type": "git",
"url": "https://github.com/marionettejs/backbone.wreqr.git"
},

"github": "https://github.com/marionettejs/backbone.wreqr",

"dependencies": {
"backbone": ">=0.9.9 <=1.1.2",
"underscore": ">=1.3.3 <=1.6.0"
Expand All @@ -61,9 +54,10 @@
"grunt-preprocess": "2.0.0",
"grunt-plato": "0.1.5",
"sinon": "1.9.0",
"jasmine-sinon": "0.3.1"
"jasmine-sinon": "0.3.1",
"grunt-template": "^0.2.3"
},
"jam":{
"jam": {
"dependencies": {
"backbone": ">=0.9.9",
"underscore": ">=1.3.1"
Expand Down
9 changes: 9 additions & 0 deletions src/wreqr.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,17 @@
}(this, function(Wreqr, Backbone, _) {
"use strict";

var previousWreqr = Backbone.Wreqr;

Backbone.Wreqr = Wreqr;

Backbone.Wreqr.VERSION = '<%= version %>';

Backbone.Wreqr.noConflict = function () {
Backbone.Wreqr = previousWreqr;
return this;
};

// @include wreqr.handlers.js
// @include wreqr.commandStorage.js
// @include wreqr.commands.js
Expand Down

0 comments on commit db96c8a

Please sign in to comment.