Comparing version 1.0.0 to 1.1.0
@@ -5,7 +5,8 @@ (function () { | ||
, mime = require('mime') | ||
, concat = require('concat-stream') | ||
, S3Adapter = function () { | ||
this.store = {}; | ||
this.knox = null; | ||
this.put = function (path, data, cb) { | ||
@@ -20,19 +21,13 @@ var headers = { | ||
}; | ||
this.get = function (path, cb) { | ||
this.knox.get(path).on('response', function(res){ | ||
var chunks=[]; | ||
res.setEncoding('utf8'); | ||
res.on('data', function(chunk){ | ||
chunks.push(chunk); | ||
}); | ||
res.on('end', function() { | ||
cb(null, Buffer.concat(chunks)); | ||
}); | ||
res.pipe(concat(function(data) { | ||
cb(null, data) | ||
})); | ||
}).end(); | ||
}; | ||
this.destroy = function (path, cb) { | ||
@@ -43,3 +38,3 @@ this.knox.deleteFile(path, function(err) { | ||
}; | ||
this.before = function (opts, cb) { | ||
@@ -54,3 +49,3 @@ this.knox = knox.createClient({ | ||
}; | ||
this.after = function (cb) { | ||
@@ -63,6 +58,6 @@ this.isReady = false; | ||
, client = new S3Adapter(); | ||
_.extend(client, base); | ||
module.exports = client; | ||
}()); |
@@ -9,3 +9,3 @@ { | ||
], | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"repository": { | ||
@@ -17,10 +17,11 @@ "type": "git", | ||
"dependencies": { | ||
"jsftp": "0.6.x" | ||
, "knox": "0.8.x" | ||
, "mime": "1.2.x" | ||
, "async": "0.2.x" | ||
, "crypto": "0.0.x" | ||
, "underscore": "1.4.x" | ||
, "wrench": "1.5.1" | ||
, "jake": "0.5.x" | ||
"async": "0.2.x", | ||
"concat-stream": "^1.5.0", | ||
"crypto": "0.0.x", | ||
"jake": "0.5.x", | ||
"jsftp": "0.6.x", | ||
"knox": "0.8.x", | ||
"mime": "1.2.x", | ||
"underscore": "1.4.x", | ||
"wrench": "1.5.1" | ||
}, | ||
@@ -27,0 +28,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
86976
9
1544
+ Addedconcat-stream@^1.5.0
+ Addedbuffer-from@1.1.2(transitive)
+ Addedconcat-stream@1.6.2(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedtypedarray@0.0.6(transitive)
+ Addedutil-deprecate@1.0.2(transitive)