Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
1,230 additions
and
1,193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "standard", | ||
"env": { | ||
"node": true, | ||
"mocha": true | ||
}, | ||
"globals": { | ||
"define": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,4 @@ build/Release | |
node_modules | ||
|
||
.idea | ||
test/data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
language: node_js | ||
node_js: | ||
- "0.12" | ||
- "4.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
var bootstrapper = require("./lib/bootstrapper.js"); | ||
module.exports = function(options) { | ||
return bootstrapper(options).start().then(function(b) { | ||
return b.reporter; | ||
}); | ||
var bootstrapper = require('./lib/bootstrapper.js') | ||
module.exports = function (options) { | ||
return bootstrapper(options).start().then(function (b) { | ||
return b.reporter | ||
}) | ||
} | ||
|
||
module.exports.Reporter = require("./lib/reporter.js"); | ||
module.exports.Bootstrapper = require("./lib/bootstrapper.js"); | ||
module.exports.Reporter = require('./lib/reporter.js') | ||
module.exports.bootstrapper = require('./lib/bootstrapper.js') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,45 @@ | ||
/*! | ||
* Copyright(c) 2014 Jan Blaha | ||
/*! | ||
* Copyright(c) 2014 Jan Blaha | ||
* FileSystem - blob storage in file system | ||
*/ | ||
*/ | ||
|
||
var util = require("util"), | ||
fs = require("fs"), | ||
path = require("path"), | ||
winston = require("winston"), | ||
mkdirp = require('mkdirp'); | ||
var fs = require('fs') | ||
var path = require('path') | ||
var mkdirp = require('mkdirp') | ||
|
||
var logger = winston.loggers.get('jsreport'); | ||
var FileSystemBlobStorage = module.exports = function (options) { | ||
this.storageDirectory = path.join(options.dataDirectory, 'storage') | ||
|
||
var FileSystemBlobStorage = module.exports = function(options) { | ||
this.storageDirectory = path.join(options.dataDirectory, "storage"); | ||
|
||
if (!fs.existsSync(this.storageDirectory)) { | ||
mkdirp.sync(this.storageDirectory); | ||
} | ||
}; | ||
if (!fs.existsSync(this.storageDirectory)) { | ||
mkdirp.sync(this.storageDirectory) | ||
} | ||
} | ||
|
||
FileSystemBlobStorage.ensureDirectory = function(dir, cb) { | ||
mkdirp(dir, cb); | ||
FileSystemBlobStorage.ensureDirectory = function (dir, cb) { | ||
mkdirp(dir, cb) | ||
} | ||
|
||
FileSystemBlobStorage.prototype.write = function (blobName, buffer, cb) { | ||
blobName = blobName + ""; | ||
var self = this; | ||
blobName = blobName + '' | ||
var self = this | ||
|
||
FileSystemBlobStorage.ensureDirectory(this.storageDirectory, function() { | ||
var blobPath = path.join(self.storageDirectory, blobName); | ||
FileSystemBlobStorage.ensureDirectory(this.storageDirectory, function () { | ||
var blobPath = path.join(self.storageDirectory, blobName) | ||
|
||
fs.writeFile(blobPath, buffer, function(err) { | ||
if (err) | ||
return cb(err); | ||
fs.writeFile(blobPath, buffer, function (err) { | ||
if (err) { | ||
return cb(err) | ||
} | ||
|
||
cb(null, blobName); | ||
}); | ||
}); | ||
}; | ||
cb(null, blobName) | ||
}) | ||
}) | ||
} | ||
|
||
FileSystemBlobStorage.prototype.read = function (blobName, cb) { | ||
blobName = blobName + ""; | ||
cb(null, fs.createReadStream(path.join(this.storageDirectory, blobName))); | ||
}; | ||
FileSystemBlobStorage.prototype.read = function (blobName, cb) { | ||
blobName = blobName + '' | ||
|
||
cb(null, fs.createReadStream(path.join(this.storageDirectory, blobName))) | ||
} | ||
|
||
module.exports = FileSystemBlobStorage; | ||
module.exports = FileSystemBlobStorage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.