YUKI Hiroshi
null+****@clear*****
Fri Dec 7 14:24:58 JST 2012
YUKI Hiroshi 2012-12-07 14:24:58 +0900 (Fri, 07 Dec 2012) New Revision: 7b24ae1fd9131598b61e2df1a7c9732489742aa2 https://github.com/groonga/gcs/commit/7b24ae1fd9131598b61e2df1a7c9732489742aa2 Log: Rename methods: getXXX => idToXXX Modified files: lib/database/storage.js Modified: lib/database/storage.js (+6 -6) =================================================================== --- lib/database/storage.js 2012-12-07 13:37:14 +0900 (5db15cd) +++ lib/database/storage.js 2012-12-07 14:24:58 +0900 (4bf14bd) @@ -24,14 +24,14 @@ FileStorage.prototype = { // because document id can be too long, we should use a short hash // string instead of full id. - getFileName: function(id) { + idToFileName: function(id) { var shasum = crypto.createHash('sha1'); shasum.update(id); return shasum.digest('hex'); }, - getFilePath: function(id) { - var filename = this.getFileName(id); + idToFilePath: function(id) { + var filename = this.idToFileName(id); return path.join(this.directoryPath, filename); }, @@ -39,7 +39,7 @@ FileStorage.prototype = { if (!this.directoryExistsSync()) mkdirp.sync(this.databaseDirectory); - var filePath = this.getFilePath(document.id); + var filePath = this.idToFilePath(document.id); if (path.existsSync(filePath)) fs.unlinkSync(filePath); @@ -53,7 +53,7 @@ FileStorage.prototype = { if (!this.directoryExistsSync()) return null; - var filePath = this.getFilePath(document.id); + var filePath = this.idToFilePath(document.id); if (path.existsSync(filePath)) return null; @@ -65,7 +65,7 @@ FileStorage.prototype = { if (!this.directoryExistsSync()) return; - var filePath = this.getFilePath(document.id); + var filePath = this.idToFilePath(document.id); if (path.existsSync(filePath)) fs.unlinkSync(filePath); }, -------------- next part -------------- HTML����������������������������...Download