Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bob

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bob - npm Package Compare versions

Comparing version 0.2.8 to 0.2.9

.gitignore

7

CHANGELOG.md

@@ -1,3 +0,6 @@

### 0.2.8
* Simplify coverage target setup by using cliffano/vows
### 0.2.9
* Make coverage target work by using cliffano/vows with cliffano/node-runforcover
* Add function support to template target, starting with now(format) function
* Rename lint target to lintstrict, hint to lint, checkstyle to style
* Add build target which calls style, lint, and test targets

@@ -4,0 +7,0 @@ ### 0.2.7

{
"bob": {
"checkstyle": {
"style": {
"opts": "--violations"
},
"lint": {
"lintstrict": {
"opts": ""
},
"hint": {
"lint": {
"opts": ""

@@ -11,0 +11,0 @@ },

{
"bob": {
"checkstyle": {
"style": {
"opts": "--checkstyle"
},
"lint": {
"lintstrict": {
"opts": "--xml-reporter"
},
"hint": {
"lint": {
"opts": "--jslint-reporter"

@@ -11,0 +11,0 @@ },

var _ = require('underscore'),
fs = require('fs');
fs = require('fs'),
Toolbelt = require('./toolbelt').Toolbelt,
toolbelt = new Toolbelt();
// Charlotte takes care of stuffs that can't be done easily from shell
function Charlotte() {

@@ -9,2 +12,3 @@

// bump major/minor/build number in package.json's version field
function versionup(type) {

@@ -23,6 +27,7 @@ var version = ((conf.version) ? conf.version : '0.0.0').split('.');

conf.version = version.join('.');
fs.writeFileSync(CONF_FILE, JSON.stringify(conf, null, 4));
fs.writeFileSync(CONF_FILE, JSON.stringify(conf, null, 2));
return conf.version;
}
// process variables in template files
function template() {

@@ -33,2 +38,3 @@ _.keys(conf.bob.template).forEach(function (file) {

conf.bob.template[file].forEach(function (prop) {
data = toolbelt.applyFn(data);
// TODO: deeper prop handling

@@ -42,4 +48,4 @@ data = data.replace(new RegExp('\\${' + prop + '}', 'g'), conf[prop]);

return {
'versionup': versionup,
'template': template
versionup: versionup,
template: template
};

@@ -46,0 +52,0 @@ }

var _ = require('underscore'),
dateformat = require('dateformat'),
jquery = require('jquery');

@@ -40,2 +41,3 @@

// combine all fields on an array of objects into a single object
function merge(objs) {

@@ -49,6 +51,27 @@ var o = {};

// primitive function support on a string data
function applyFn(data) {
var FUNCTIONS = {
'now': function (format) {
return dateformat(new Date(), format);
}
};
_.keys(FUNCTIONS).forEach(function (func) {
var regex = new RegExp('\\${' + func + '.*}', 'g'),
exp = data.match(regex).toString();
if (exp) {
arg = exp
.replace(new RegExp('\\${' + func + '\\(\'', 'g'), '')
.replace(new RegExp('\'\\)}', 'g'), '');
data = data.replace(regex, FUNCTIONS[func](arg));
}
});
return data;
}
return {
args: args,
merge: merge,
val: val
val: val,
applyFn: applyFn
};

@@ -55,0 +78,0 @@ }

@@ -6,11 +6,11 @@ {

"build",
"lint",
"hint",
"checkstyle",
"test",
"coverage",
"nodelint",
"jshint",
"jscheckstyle",
"vows",
"runforcover",
"deploy",
"make"
],
"version": "0.2.8",
"version": "0.2.9",
"homepage": "http://github.com/cliffano/bob",

@@ -34,2 +34,3 @@ "author": "Cliffano Subagio <blah@cliffano.com> (http://blog.cliffano.com)",

"dependencies": {
"dateformat": "1.0.2-1.2.3",
"jquery": "1.6.3",

@@ -52,2 +53,2 @@ "nomnom": "1.0.0",

]
}
}

@@ -9,3 +9,3 @@ Bob

Bob provides common build targets (clean, checkstyle, lint, test, coverage, package, deploy, stop, start, status, restart) for Node.js libs/apps. It essentially allows multiple projects to use the same Makefile stored in a global node_modules. Bob uses bash shell.
Bob provides common build targets (clean, style, lint, test, cover, package, deploy, stop, start, status, restart) for Node.js libs/apps. It essentially allows multiple projects to use the same Makefile stored in a global node_modules. Bob requires bash shell.

@@ -35,11 +35,11 @@ Installation

},
"checkstyle": {
"style": {
"files": "foo.js bar/",
"opts": "--checkstyle"
},
"hint": {
"lint": {
"files": "foo.js bar/",
"opts": "--jslint-reporter --config path/to/hintconfig.js"
},
"lint": {
"lintstrict": {
"files": "foo.js bar/",

@@ -109,5 +109,5 @@ "opts": "--reporter path/to/lintreporter.js --config path/to/lintconfig.js"

* clean - Delete build/ and run/ directories, along with any nohup.* and *.log files
* checkstyle - Run `jscheckstyle` against all .js files under lib/ directory, configurable via {bob.checkstyle.files}
* lint - Run `nodelint` against all .js files under lib/ and test/ directories, configurable via {bob.lint.files}
* hint - Run `jshint` against all .js files under lib/ and test/ directories, configurable via {bob.hint.files}
* style - Run `jscheckstyle` against all .js files under lib/ directory, configurable via {bob.style.files}
* lintstrict - Run `nodelint` against all .js files under lib/ and test/ directories, configurable via {bob.lintstrict.files}
* lint - Run `jshint` against all .js files under lib/ and test/ directories, configurable via {bob.lint.files}
* test - Run `vows` against all .js files under test/ directory, configurable via {bob.test.files}. Run `npm test` if scripts.test exists in package.json

@@ -114,0 +114,0 @@ * coverage - Run `vows` against all .js files under test/ directory with coverage flag, configurable via {bob.coverage.files}

var assert = require('assert'),
sandboxedmodule = require('sandboxed-module'),
vows = require('vows');
vows = require('vows'),
mockToolbelt;
mockToolbelt = {
Toolbelt: function () {
return {
applyFn: function (data) {
return data;
}
};
}
};
function getVersionUpCharlotte(origVersion, newVersion) {

@@ -18,3 +29,4 @@ var mockFs = {

requires: {
'fs': mockFs
'fs': mockFs,
'./toolbelt': mockToolbelt
}

@@ -41,3 +53,4 @@ });

requires: {
'fs': mockFs
'fs': mockFs,
'./toolbelt': mockToolbelt
}

@@ -44,0 +57,0 @@ });

var assert = require('assert'),
Toolbelt = require('../lib/toolbelt').Toolbelt,
sandboxedmodule = require('sandboxed-module'),
vows = require('vows'),

@@ -10,3 +10,11 @@ conf = { name: 'myproject', version: '8.8.8', path: '/foo/bar/${name}/${version}',

topic: function () {
return new Toolbelt();
var toolbelt = sandboxedmodule.require('../lib/toolbelt', {
requires: {
'dateformat': function (date, format) {
assert.equal(format, 'yyyymmddhhMMss');
return '20110102030405';
}
}
});
return new toolbelt.Toolbelt();
},

@@ -89,4 +97,8 @@ 'val should return value when property exists': function (topic) {

assert.isEmpty(merge);
},
'func should replace now function with correct format': function (topic) {
var data = topic.applyFn('aaa ${now(\'yyyymmddhhMMss\')} bbb');
assert.equal(data, 'aaa 20110102030405 bbb');
}
}
}).exportTo(module);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc