Skip to content

Commit

Permalink
Merge pull request #1205 from acrobat/datepicker-object-version
Browse files Browse the repository at this point in the history
Added version to datepicker object
  • Loading branch information
hebbet committed Feb 26, 2015
2 parents c333944 + 77fbe38 commit b9ac68a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
42 changes: 42 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,44 @@ module.exports = function(grunt){
}
]
}
},
'string-replace': {
js: {
files: [{
src: 'js/bootstrap-datepicker.js',
dest: 'js/bootstrap-datepicker.js'
}],
options: {
replacements: [{
pattern: '$.fn.datepicker.version = "1.4.0";',
replacement: '$.fn.datepicker.version = "' + grunt.option('newver') + '";'
}]
}
},
npm: {
files: [{
src: 'package.json',
dest: 'package.json'
}],
options: {
replacements: [{
pattern: '"version": "1.4.0",',
replacement: '"version": "' + grunt.option('newver') + '",'
}]
}
},
bower: {
files: [{
src: 'bower.json',
dest: 'bower.json'
}],
options: {
replacements: [{
pattern: '"version": "1.4.0",',
replacement: '"version": "' + grunt.option('newver') + '",'
}]
}
}
}
});

Expand All @@ -179,6 +217,10 @@ module.exports = function(grunt){
grunt.registerTask('lint-css', 'Lint all css files', ['dist-css', 'csslint:dist']);
grunt.registerTask('test', 'Lint files and run unit tests', ['lint-js', /*'lint-css',*/ 'qunit']);

// Version numbering task.
// grunt bump-version --newver=X.Y.Z
grunt.registerTask('bump-version', 'string-replace');

// Docs task.
grunt.registerTask('screenshots', 'Rebuilds automated docs screenshots', function(){
var phantomjs = require('phantomjs').path;
Expand Down
3 changes: 3 additions & 0 deletions js/bootstrap-datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,9 @@
return this;
};

/* DATEPICKER VERSION
* =================== */
$.fn.datepicker.version = "1.4.0";

/* DATEPICKER DATA-API
* ================== */
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"grunt-contrib-cssmin": "~0.10.0",
"grunt-contrib-clean": "~0.6.0",
"grunt-contrib-concat": "~0.5.0",
"grunt-string-replace": "~1.0.0",
"grunt-banner": "~0.2.3",
"time-grunt": "~1.0.0",
"phantomjs": "~1.9.0"
Expand Down

0 comments on commit b9ac68a

Please sign in to comment.