New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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

to
0.3.3

.gitignore

5

CHANGELOG.md

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

### 0.3.3 (SNAPSHOT)
* Fix config value handling when dsv is x.y.z with undefined x.y but z exists
* Add doc target, using ndoc as default doc tool
* Replace jquery object extend with valentine's
### 0.3.2

@@ -2,0 +7,0 @@ * Send target no longer creates base directory

@@ -46,2 +46,11 @@ {

},
"BOB_DOC_BIN": {
"default": "node_modules/ndoc/bin/ndoc"
},
"BOB_DOC_FILES": {
"default": "lib/"
},
"BOB_DOC_OPTS": {
"default": "-o build/report/doc"
},
"BOB_PACKAGEMETA_DIR": {

@@ -48,0 +57,0 @@ },

26

lib/bob.js
var _ = require('underscore'),
fs = require('fs'),
jquery = require('jquery'),
Make = require('./make').Make,
p = require('path'),
PackageJson = require('./packagejson').PackageJson,
util = require('./util');
util = require('./util'),
valentine = require('valentine');

@@ -22,9 +22,9 @@ // Bob takes care of executing Make with specified params and targets

var keys = makeJson.params,
config = jquery.extend(true, pkg, JSON.parse(fs.readFileSync(p.join(opts.bobDir, 'conf/mode/' + opts.mode + '.json')))),
config = valentine.extend(pkg, JSON.parse(fs.readFileSync(p.join(opts.bobDir, 'conf/mode/' + opts.mode + '.json')))),
params = [];
// each key FOO_BAR coresponds to pkg's { foo: { bar: '' }}
keys.BOB_DIR = { default: opts.bobDir };
keys.APP_DIR = { default: opts.appDir };
keys.NODE_ENV = { default: (process.env.NODE_ENV || 'development') };
keys.BOB_DIR = { 'default': opts.bobDir };
keys.APP_DIR = { 'default': opts.appDir };
keys.NODE_ENV = { 'default': (process.env.NODE_ENV || 'development') };

@@ -40,10 +40,10 @@ _.keys(keys).forEach(function (key) {

// use type-based value if bob.<target>.type is supplied
} else if (props.match(/^bob\./)
&& props.split('.').length >= 3
&& keys[key][util.val(props.replace(/\.[^\.]+$/, '.type'), pkg)]) {
} else if (props.match(/^bob\./) &&
props.split('.').length >= 3 &&
keys[key][util.val(props.replace(/\.[^\.]+$/, '.type'), pkg)]) {
params[key] = keys[key][util.val(props.replace(/\.[^\.]+$/, '.type'), pkg)];
// use default value as last resort
} else if (keys[key].default) {
params[key] = keys[key].default;
} else if (keys[key]['default']) {
params[key] = keys[key]['default'];
}

@@ -79,5 +79,5 @@

build: build
}
};
}
exports.Bob = Bob;

@@ -27,5 +27,5 @@ var _ = require('underscore'),

versionUp: versionUp
}
};
}
exports.Charlotte = Charlotte;

@@ -15,2 +15,3 @@ var _ = require('underscore'),

});
///console.log('args: ' + args);

@@ -37,5 +38,5 @@ // spawn make process

exec: exec
}
};
}
exports.Make = Make;

@@ -8,3 +8,3 @@ var fs = require('fs');

function read() {
return JSON.parse(fs.readFileSync(file));
return JSON.parse(fs.readFileSync(file));
}

@@ -14,3 +14,3 @@

function write(pkg) {
fs.writeFileSync(file, JSON.stringify(pkg, null, 2));
fs.writeFileSync(file, JSON.stringify(pkg, null, 2));
}

@@ -20,8 +20,8 @@

function versionUp(type) {
var pkg = read(),
version = ((pkg.version) ? pkg.version : '0.0.0').split('.');
var pkg = read(),
version = ((pkg.version) ? pkg.version : '0.0.0').split('.');
if (type === 'major') {
version = [++version[0], 0, 0];
} else if (type === 'minor') {
version = [version[0], ++version[1], 0];
version = [version[0], ++version[1], 0];
} else {

@@ -36,5 +36,5 @@ version = [version[0], version[1], ++version[2]];

return {
read: read,
versionUp: versionUp,
write: write
read: read,
versionUp: versionUp,
write: write
};

@@ -41,0 +41,0 @@ }

@@ -10,3 +10,3 @@ var _ = require('underscore'),

if (typeof data !== 'string') {
if (typeof data !== 'string' || _.isEmpty(params)) {
return data;

@@ -46,9 +46,15 @@ }

function val(dsv, obj) {
var val;
var value;
if (dsv && obj) {
dsv.split('.').forEach(function (prop) {
val = (val) ? val[prop] : obj[prop];
});
var props = dsv.split('.');
for (var i = 0, ln = props.length; i < ln; i += 1) {
value = (value) ? value[props[i]] : obj[props[i]];
if (value === undefined) {
break;
}
}
}
return val;
return value;
}

@@ -55,0 +61,0 @@

@@ -13,3 +13,3 @@ {

],
"version": "0.3.2",
"version": "0.3.3",
"homepage": "http://github.com/cliffano/bob",

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

"scripts": {
"test": "vows --spec `find test -name \"*.js\"`"
"test": "npm install -g bob; bob clean lint test coverage;"
},

@@ -40,12 +40,13 @@ "repository": {

"expresso": "0.9.2",
"jquery": "1.6.3",
"jscheckstyle": "0.0.4",
"jshint": "0.5.7",
"ndoc": "1.0.7",
"nodelint": "0.5.2",
"nomnom": "1.5.1",
"underscore": "1.2.2",
"valentine": "1.4.7",
"vows": "http://nodeload.github.com/cloudhead/vows/tarball/master"
},
"devDependencies": {
"sandboxed-module": "0.1.2"
"sandboxed-module": "0.1.3"
},

@@ -52,0 +53,0 @@ "engines": {

Sorry, the diff of this file is not supported yet