null+****@clear*****
null+****@clear*****
2012年 6月 28日 (木) 15:18:14 JST
SHIMODA Hiroshi 2012-06-28 15:18:14 +0900 (Thu, 28 Jun 2012) New Revision: 79adef3b62adde3e181e5051023ee2bb8661285d https://github.com/groonga/gcs/commit/79adef3b62adde3e181e5051023ee2bb8661285d Log: Remove obsolete "batch" command Removed files: bin/batch Deleted: bin/batch (+0 -69) 100644 =================================================================== --- bin/batch 2012-06-28 13:38:29 +0900 (8095ded) +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env node -/* vim: set filetype=javascript */ - -var nroonga = require('nroonga'); -var program = require('commander'); -var fs = require('fs'); -var BatchProcessor = require('batch/processor').Processor; - -program - .usage('[options] [batch files]...') - .option('--database-path <path>', - 'path to the database file [(project root)/database/gcs]', - String, - __dirname + '/../database/gcs') - .option('--domain <name>', - 'the name of the domain', - String) - .option('--encoding <encoding>', - 'character encoding of batch files [UTF-8]', - String, - 'UTF-8') - .parse(process.argv); - -function BatchCommand(options) { - this.databasePath = options.databasePath; - this.domain = options.domain; - this.encoding = options.encoding; - this.init(); -} -BatchCommand.prototype = { - init: function() { - this.assertOptions(); - - console.log('domain = ' + this.domain); - console.log('database = ' + this.databasePath); - }, - - assertOptions: function() { - if (!this.domain) - throw new Error('You must specify the domain name!'); - }, - - processAll: function(paths) { - for (var i = 0, maxi = paths.length; i < maxi; i++) { - this.process(paths[i]); - } - }, - - process: function(path) { - console.log('processing batch file [' + path + ']...'); - - var batch = fs.readFileSync(path, this.encoding) - batch = JSON.parse(batch); - var processor = BatchProcessor.new({ - databasePath: this.databasePath, - domain: this.domain - }); - processor.process(batch); - } -} - -var batchProcessor = new BatchProcessor({ - databasePath: program.databasePath, - domain: program.domain, - encoding: program.encoding - }); - -var batcheFilePaths = program.args; -batchProcessor.processAll(batcheFilePaths); -------------- next part -------------- HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B... Descargar