Skip to content

Commit

Permalink
Merge branch 'master' of github.com:wlaurance/faux-knox
Browse files Browse the repository at this point in the history
  • Loading branch information
wlaurance committed Jan 10, 2014
2 parents e7d15f8 + 4cd8a02 commit 94fb030
Show file tree
Hide file tree
Showing 293 changed files with 14 additions and 53,917 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ logs
results

npm-debug.log
node_modules
12 changes: 8 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ exports.createClient = function(config){
}
}
Client.prototype.getFile = function(uri, headers, callback){
if (!callback && typeof(headers) == "function") {
callback = headers;
headers = {};
}
var stream = fs.createReadStream(config.bucket + uri);
function cancelLocalListeners(){
stream.removeListener('error', bad);
Expand Down Expand Up @@ -42,7 +46,7 @@ exports.createClient = function(config){
}
function checkFromPath(cb){
fs.stat(from, cb);
};
}
async.series([checkFromPath, checkToPath], function(err){
if (err) {
return callback(err);
Expand All @@ -57,7 +61,7 @@ exports.createClient = function(config){
});
r.pipe(w);
});
}
};
Client.prototype.putBuffer = function(buffer, to, headers, callback){
utils.checkToPath(config.bucket + to, function(){
fs.writeFile(config.bucket + to, buffer, function(err){
Expand All @@ -67,12 +71,12 @@ exports.createClient = function(config){
return callback(null, {headers:{}, statusCode:201});
});
});
}
};
Client.prototype.deleteFile = function(file, callback){
fs.unlink(config.bucket + file, function(err){
return callback(null, {headers:{}, statusCode: err ? 404 : 204});
});
}
};
}
return new Client(config);
};
Expand Down
1 change: 0 additions & 1 deletion node_modules/.bin/_mocha

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/mocha

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/rimraf

This file was deleted.

19 changes: 0 additions & 19 deletions node_modules/async/LICENSE

This file was deleted.

Loading

0 comments on commit 94fb030

Please sign in to comment.