cache-storage
Advanced tools
Comparing version 1.2.0 to 1.2.1
// Generated by CoffeeScript 1.6.3 | ||
(function() { | ||
var Cache, FileStorage, Storage, fs, | ||
var Cache, FileStorage, Storage, fs, path, | ||
__hasProp = {}.hasOwnProperty, | ||
@@ -9,2 +9,4 @@ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; | ||
path = require('path'); | ||
Storage = require('./Storage'); | ||
@@ -21,2 +23,9 @@ | ||
this.directory = directory; | ||
this.directory = path.resolve(this.directory); | ||
if (!fs.existsSync(this.directory)) { | ||
throw new Error('FileStorage: directory ' + this.directory + ' does not exists'); | ||
} | ||
if (!fs.statSync(this.directory).isDirectory()) { | ||
throw new Error('FileStorage: path ' + this.directory + ' must be directory'); | ||
} | ||
} | ||
@@ -23,0 +32,0 @@ |
{ | ||
"name": "cache-storage", | ||
"description": "Cache storage for node js", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "David Kudera", |
@@ -130,2 +130,5 @@ # cache-storage | ||
* 1.2.1 | ||
+ FileStorage throw error if path does not exists or if it is a directory | ||
+ 1.2.0 | ||
@@ -132,0 +135,0 @@ + Bugs in dependencies parser |
@@ -12,3 +12,3 @@ (function () { | ||
describe('Cache - FileStorage', function() { | ||
describe('Cache', function() { | ||
@@ -15,0 +15,0 @@ beforeEach(function() { |
(function () { | ||
require('./FileStorage'); | ||
require('./Cache'); | ||
})(); |
Sorry, the diff of this file is not supported yet
33807
18
594
156