Skip to content

Commit

Permalink
Merge pull request #584 from cesine/preversion
Browse files Browse the repository at this point in the history
added Rickshaw.version fixes #538 fixes #224
  • Loading branch information
cesine authored Jul 29, 2017
2 parents f92fe3d + c52d5ee commit ef1da3e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*.log
*swp
yarn-error.log
yarn.lock

# Dependency directories
node_modules
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rickshaw",
"version": "1.6.0-rc.0",
"version": "1.6.0",
"description": "Rickshaw is a JavaScript toolkit for creating interactive time series graphs.",
"main": "./rickshaw",
"license": "MIT",
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
"test": "make && nodeunit tests",
"watch": "nodemon --watch src --exec make rickshaw.js",
"coverage": "istanbul cover nodeunit tests --reporter=lcov",
"coveralls": "cat ./coverage/lcov.info | coveralls"
"coveralls": "cat ./coverage/lcov.info | coveralls",
"preversion:src": "sed \"s/version: '[^,]*'/version: '$npm_package_version'/\" src/js/Rickshaw.js > output && mv output src/js/Rickshaw.js",
"preversion:bower": "sed 's/\"version\": \"[^,]*\"/\"version\": \"'$npm_package_version'\"/' bower.json > output && mv output bower.json",
"version": "npm run preversion:src && npm run preversion:bower && make clean && make && npm test && git add -A src bower.json rickshaw.js rickshaw.min.js"
}
}
3 changes: 2 additions & 1 deletion src/js/Rickshaw.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* jshint -W079 */
/* jshint -W079 */

var Rickshaw = {
version: '1.6.0',

namespace: function(namespace, obj) {

Expand Down
8 changes: 8 additions & 0 deletions tests/Rickshaw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
var Rickshaw = require('../rickshaw');
var package = require('../package.json');

exports.load = function(test) {

test.equal(Rickshaw.version, package.version, 'Rickshaw.version is defined');
test.done();
};

0 comments on commit ef1da3e

Please sign in to comment.