YUKI Hiroshi
yuki****@clear*****
Tue Jul 23 10:54:00 JST 2013
このmodelという名前は、「Request-Response型」とか「Publish−Subscribe型」 とかの、コミュニケーションの方式(通信モデル)が複数あって、それらを包括 して何と呼ぶかということに焦点を当てての選択の結果でした。 単純な親子関係の継承では複数ある特性のうちどれか1つしか名前付けに使えな いので、「通信モデルは何か」という所にとりあえず焦点を当ててみたというこ とです。 その制限を念頭に置かないのであれば、これはMixinで実装するべき所のような 気もします。 Mixinであれば、基底クラスが「Command」で、そこに「RequestResponseXXX」の ような特性を付け加えていき新しいコマンドを作成する、というやり方がしっく り来るのかなあと思っています。 そうしていなかったのは、その点に思い至らなかったのと、Node.jsでMixinする 方法を把握していなかったからです。Mixinにできるのであれば、そうするのが いい気がしています。 Kouhei Sutou wrote: > In <51EDD99C.3060909 �� clear-code.com> > "Re: [Groonga-commit] groonga/express-droonga �� 8824cfd [master] model.REST -> model.HTTPCommand" on Tue, 23 Jul 2013 10:17:16 +0900, > YUKI Hiroshi <yuki �� clear-code.com> wrote: > >> こちらの変更ありがとうございます。 >> express-droongaを使っている別プロジェクトでも参照している部分があるの >> で、直しておく必要がありますね。 > > あ、これ、まだ名前が変わるかもです。 > これはmodelなのか?というのがモヤモヤしています。commandでい > いんじゃないかなぁと思っていたりします。 > >> Kouhei Sutou wrote: >>> Author >>> Kouhei Sutou <kou �� clear-code.com> >>> Date >>> 2013-07-22 23:21:29 +0900 (Mon, 22 Jul 2013) >>> New Revision >>> 8824cfda364d678513bdfb52340823ad4f917fc8 >>> <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8> >>> Message >>> >>> model.REST -> model.HTTPCommand >>> >>> Because the model should handle all generic HTTP commands. >>> >>> Modified files >>> >>> * lib/adapter/api/rest.js >>> <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#diff-0> >>> * lib/adapter/http.js >>> <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#diff-1> >>> * lib/model.js >>> <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#diff-2> >>> * test/adapter/rest.test.js >>> <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#diff-3> >>> * test/adapter/socket.io.test.js >>> <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#diff-4> >>> * test/express-adapter.test.js >>> <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#diff-5> >>> >>> Modified: lib/adapter/api/rest.js (+8 -8) >>> =================================================================== >>> >>> ... <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L1> >>> 2 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L2> >>> 3 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L3> >>> 4 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L4> >>> 5 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L5> >>> >>> 6 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L6> >>> 7 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L7> >>> 8 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L8> >>> 9 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L9> >>> >>> 10 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L10> >>> 11 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L11> >>> 12 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L12> >>> 13 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L13> >>> 14 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L14> >>> 15 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L15> >>> >>> 16 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L16> >>> 17 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L17> >>> 18 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L18> >>> 19 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L19> >>> 20 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L20> >>> >>> 21 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L21> >>> 22 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L22> >>> 23 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L23> >>> 24 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L24> >>> 25 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L25> >>> >>> 26 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L26> >>> 27 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L27> >>> 28 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L28> >>> 29 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L29> >>> 30 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L30> >>> >>> 31 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L31> >>> 32 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L32> >>> 33 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L33> >>> 34 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L34> >>> 35 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L35> >>> >>> 36 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L36> >>> 37 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L37> >>> 38 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L38> >>> 39 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L39> >>> 40 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L40> >>> >>> 41 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L41> >>> 42 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L42> >>> 43 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0L43> >>> >>> >>> >>> ... <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R1> >>> 2 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R2> >>> 3 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R3> >>> 4 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R4> >>> >>> 5 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R5> >>> 6 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R6> >>> 7 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R7> >>> 8 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R8> >>> >>> 9 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R9> >>> 10 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R10> >>> 11 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R11> >>> 12 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R12> >>> 13 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R13> >>> 14 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R14> >>> >>> 15 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R15> >>> 16 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R16> >>> 17 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R17> >>> 18 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R18> >>> 19 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R19> >>> >>> 20 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R20> >>> 21 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R21> >>> 22 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R22> >>> 23 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R23> >>> 24 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R24> >>> >>> 25 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R25> >>> 26 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R26> >>> 27 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R27> >>> 28 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R28> >>> 29 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R29> >>> >>> 30 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R30> >>> 31 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R31> >>> 32 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R32> >>> 33 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R33> >>> 34 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R34> >>> >>> 35 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R35> >>> 36 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R36> >>> 37 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R37> >>> 38 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R38> >>> 39 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R39> >>> >>> 40 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R40> >>> 41 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R41> >>> 42 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R42> >>> 43 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L0R43> >>> >>> >>> >>> @@ -2,42 +2,42 @@var model = require('../../model'); >>> var requestBuilders = require('./rest-request-builder'); >>> >>> module.exports = { >>> -// 'status': new model.REST({ >>> +// 'status': new model.HTTPCommand({ >>> // path: '/status/:target', >>> // toBackend: requestBuilders.status >>> // }), >>> - 'search': new model.REST({ >>> + 'search': new model.HTTPCommand({ >>> path: '/tables/:tableName', >>> toBackend: function(event, request) { >>> return [event, requestBuilders.search(request)]; >>> } >>> }) //, >>> -// 'createtable': new model.REST({ >>> +// 'createtable': new model.HTTPCommand({ >>> // method: 'PUT', >>> // path: '/tables/:tableName', >>> // toBackend: requestBuilders.createTable >>> // }), >>> -// 'removetable': new model.REST({ >>> +// 'removetable': new model.HTTPCommand({ >>> // method: 'DELETE', >>> // path: '/tables/:tableName', >>> // toBackend: requestBuilders.removeTable >>> // }), >>> -// 'createcolumn': new model.REST({ >>> +// 'createcolumn': new model.HTTPCommand({ >>> // method: 'PUT', >>> // path: '/tables/:tableName/columns/:columnName', >>> // toBackend: requestBuilders.createColumn >>> // }), >>> -// 'removecolumn': new model.REST({ >>> +// 'removecolumn': new model.HTTPCommand({ >>> // method: 'DELETE', >>> // path: '/tables/:tableName/columns/:columnName', >>> // toBackend: requestBuilders.removeColumn >>> // }), >>> -// 'loadrecord': new model.REST({ >>> +// 'loadrecord': new model.HTTPCommand({ >>> // method: 'PUT', >>> // path: '/tables/:tableName/records/:key', >>> // toBackend: requestBuilders.loadRecord >>> // }), >>> -// 'loadrecords': new model.REST({ >>> +// 'loadrecords': new model.HTTPCommand({ >>> // method: 'PUT', >>> // path: '/tables/:tableName/records', >>> // toBackend: requestBuilders.loadRecords >>> >>> Modified: lib/adapter/http.js (+2 -2) >>> =================================================================== >>> >>> ... <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1L69> >>> 70 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1L70> >>> 71 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1L71> >>> 72 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1L72> >>> 73 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1L73> >>> >>> 74 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1L74> >>> 75 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1L75> >>> 76 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1L76> >>> ... <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1L78> >>> 79 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1L79> >>> 80 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1L80> >>> 81 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1L81> >>> 82 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1L82> >>> >>> 83 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1L83> >>> 84 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1L84> >>> 85 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1L85> >>> >>> >>> >>> ... <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1R69> >>> 70 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1R70> >>> 71 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1R71> >>> 72 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1R72> >>> >>> 73 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1R73> >>> 74 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1R74> >>> 75 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1R75> >>> 76 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1R76> >>> ... <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1R78> >>> 79 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1R79> >>> 80 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1R80> >>> 81 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1R81> >>> >>> 82 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1R82> >>> 83 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1R83> >>> 84 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1R84> >>> 85 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L1R85> >>> >>> >>> >>> @@ -70,7 +70,7 @@exports.register = function(application, params) { >>> commandSets.forEach(function(commandSet) { >>> Object.keys(commandSet).forEach(function(commandName) { >>> var definition = commandSet[commandName]; >>> - if (!model.REST.isInstance(definition)) >>> + if (!model.HTTPCommand.isInstance(definition)) >>> return; >>> unifiedCommandSet[commandName] = definition; >>> }); >>> @@ -79,7 +79,7 @@exports.register = function(application, params) { >>> var registeredCommands = []; >>> Object.keys(unifiedCommandSet).forEach(function(commandName) { >>> var definition = unifiedCommandSet[commandName]; >>> - if (!model.REST.isInstance(definition)) >>> + if (!model.HTTPCommand.isInstance(definition)) >>> return; >>> var method = getRegisterationMethod(definition.method); >>> var handler = createHandler({ >>> >>> Modified: lib/model.js (+7 -7) >>> =================================================================== >>> >>> ... <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L37> >>> 38 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L38> >>> 39 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L39> >>> 40 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L40> >>> 41 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L41> >>> >>> 42 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L42> >>> 43 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L43> >>> >>> 44 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L44> >>> 45 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L45> >>> 46 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L46> >>> 47 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L47> >>> 48 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L48> >>> 49 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L49> >>> 50 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L50> >>> 51 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L51> >>> >>> >>> >>> 52 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L52> >>> 53 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L53> >>> 54 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L54> >>> >>> 55 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L55> >>> 56 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L56> >>> 57 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L57> >>> >>> 58 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L58> >>> 59 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L59> >>> 60 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2L60> >>> >>> >>> >>> ... <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R37> >>> 38 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R38> >>> 39 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R39> >>> 40 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R40> >>> >>> 41 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R41> >>> 42 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R42> >>> >>> 43 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R43> >>> 44 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R44> >>> 45 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R45> >>> 46 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R46> >>> 47 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R47> >>> 48 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R48> >>> >>> >>> >>> 49 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R49> >>> 50 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R50> >>> 51 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R51> >>> 52 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R52> >>> 53 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R53> >>> >>> 54 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R54> >>> 55 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R55> >>> 56 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R56> >>> >>> 57 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R57> >>> 58 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R58> >>> 59 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R59> >>> 60 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L2R60> >>> >>> >>> >>> @@ -38,23 +38,23 @@exports.PublishSubscribe = PublishSubscribe; >>> >>> >>> >>> -function REST(options) { >>> +function HTTPCommand(options) { >>> RequestResponse.apply(this, arguments); >>> - this._modelTypes.push(REST); >>> + this._modelTypes.push(HTTPCommand); >>> // default handler >>> this._options.toBackend = this._options.toBackend || function(event, request) { >>> return [event, {}]; >>> }; >>> } >>> -REST.prototype = new RequestResponse(); >>> -REST.isInstance = RequestResponse.isInstance; >>> -Object.defineProperty(REST.prototype, 'path', { >>> +HTTPCommand.prototype = new RequestResponse(); >>> +HTTPCommand.isInstance = RequestResponse.isInstance; >>> +Object.defineProperty(HTTPCommand.prototype, 'path', { >>> get: function() { return this._options.path; } >>> }); >>> -Object.defineProperty(REST.prototype, 'method', { >>> +Object.defineProperty(HTTPCommand.prototype, 'method', { >>> get: function() { return this._options.method || 'GET'; } >>> }); >>> -exports.REST = REST; >>> +exports.HTTPCommand = HTTPCommand; >>> >>> >>> >>> >>> Modified: test/adapter/rest.test.js (+7 -7) >>> =================================================================== >>> >>> ... <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L11> >>> 12 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L12> >>> 13 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L13> >>> 14 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L14> >>> 15 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L15> >>> >>> 16 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L16> >>> 17 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L17> >>> 18 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L18> >>> >>> 19 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L19> >>> 20 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L20> >>> 21 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L21> >>> 22 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L22> >>> >>> 23 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L23> >>> 24 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L24> >>> 25 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L25> >>> 26 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L26> >>> >>> 27 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L27> >>> 28 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L28> >>> 29 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L29> >>> 30 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L30> >>> 31 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L31> >>> 32 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L32> >>> 33 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L33> >>> >>> 34 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L34> >>> 35 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L35> >>> 36 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L36> >>> 37 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L37> >>> >>> 38 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L38> >>> 39 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L39> >>> 40 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L40> >>> ... <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L70> >>> 71 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L71> >>> 72 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L72> >>> 73 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L73> >>> 74 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L74> >>> >>> 75 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L75> >>> 76 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L76> >>> 77 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3L77> >>> >>> >>> >>> ... <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R11> >>> 12 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R12> >>> 13 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R13> >>> 14 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R14> >>> >>> 15 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R15> >>> 16 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R16> >>> 17 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R17> >>> >>> 18 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R18> >>> 19 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R19> >>> 20 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R20> >>> 21 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R21> >>> >>> 22 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R22> >>> 23 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R23> >>> 24 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R24> >>> 25 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R25> >>> >>> 26 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R26> >>> 27 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R27> >>> 28 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R28> >>> 29 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R29> >>> 30 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R30> >>> 31 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R31> >>> 32 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R32> >>> >>> 33 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R33> >>> 34 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R34> >>> 35 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R35> >>> 36 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R36> >>> >>> 37 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R37> >>> 38 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R38> >>> 39 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R39> >>> 40 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R40> >>> ... <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R70> >>> 71 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R71> >>> 72 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R72> >>> 73 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R73> >>> >>> 74 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R74> >>> 75 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R75> >>> 76 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R76> >>> 77 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L3R77> >>> >>> >>> >>> @@ -12,29 +12,29 @@var restAPI = require('../../lib/adapter/api/rest'); >>> suite('HTTP Adapter', function() { >>> test('registeration of plugin commands', function() { >>> var basePlugin = { >>> - getCommand: new model.REST({ >>> + getCommand: new model.HTTPCommand({ >>> path: '/get' >>> }), >>> - putCommand: new model.REST({ >>> + putCommand: new model.HTTPCommand({ >>> method: 'PUT', >>> path: '/put' >>> }), >>> - postCommand: new model.REST({ >>> + postCommand: new model.HTTPCommand({ >>> method: 'POST', >>> path: '/post' >>> }), >>> - deleteCommand: new model.REST({ >>> + deleteCommand: new model.HTTPCommand({ >>> method: 'DELETE', >>> path: '/delete' >>> }), >>> ignored: new model.SocketCommand() >>> }; >>> var overridingPlugin = { >>> - postCommand: new model.REST({ >>> + postCommand: new model.HTTPCommand({ >>> method: 'POST', >>> path: '/post/overridden' >>> }), >>> - deleteCommand: new model.REST({ >>> + deleteCommand: new model.HTTPCommand({ >>> method: 'DELETE', >>> path: '/delete/overridden' >>> }) >>> @@ -71,7 +71,7 @@suite('HTTP Adapter', function() { >>> >>> suite('registeration', function() { >>> var testPlugin = { >>> - adapter: new model.REST({ >>> + adapter: new model.HTTPCommand({ >>> path: '/path/to/adapter', >>> toBackend: function(event, request) { return [event, 'adapter requested']; }, >>> toClient: function(event, data) { return [event, 'adapter OK']; } >>> >>> Modified: test/adapter/socket.io.test.js (+1 -1) >>> =================================================================== >>> >>> ... <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L4L57> >>> 58 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L4L58> >>> 59 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L4L59> >>> 60 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L4L60> >>> 61 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L4L61> >>> >>> 62 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L4L62> >>> 63 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L4L63> >>> 64 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L4L64> >>> >>> >>> >>> ... <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L4R57> >>> 58 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L4R58> >>> 59 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L4R59> >>> 60 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L4R60> >>> >>> 61 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L4R61> >>> 62 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L4R62> >>> 63 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L4R63> >>> 64 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L4R64> >>> >>> >>> >>> @@ -58,7 +58,7 @@suite('Socket.IO Adapter', function() { >>> putCommand: new model.SocketRequestResponse(), >>> postCommand: new model.SocketRequestResponse(), >>> deleteCommand: new model.SocketRequestResponse(), >>> - ignored: new model.REST() >>> + ignored: new model.HTTPCommand() >>> }; >>> var overridingPlugin = { >>> postCommand: new model.SocketRequestResponse(), >>> >>> Modified: test/express-adapter.test.js (+1 -1) >>> =================================================================== >>> >>> ... <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L5L9> >>> 10 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L5L10> >>> 11 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L5L11> >>> 12 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L5L12> >>> 13 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L5L13> >>> >>> 14 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L5L14> >>> 15 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L5L15> >>> 16 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L5L16> >>> >>> >>> >>> ... <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L5R9> >>> 10 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L5R10> >>> 11 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L5R11> >>> 12 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L5R12> >>> >>> 13 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L5R13> >>> 14 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L5R14> >>> 15 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L5R15> >>> 16 <https://github.com/groonga/express-droonga/commit/8824cfda364d678513bdfb52340823ad4f917fc8#L5R16> >>> >>> >>> >>> @@ -10,7 +10,7 @@var model = require('../lib/model'); >>> >>> suite('Adaption for express application', function() { >>> var testRestPlugin = { >>> - api: new model.REST({ >>> + api: new model.HTTPCommand({ >>> path: '/path/to/api', >>> toBackend: function(event, request) { return [event, 'api requested']; }, >>> toClient: function(event, data) { return [event, 'api OK']; } >>> >>> >>> >>> _______________________________________________ >>> Groonga-commit mailing list >>> Groonga-commit �� lists.sourceforge.jp >>> http://lists.sourceforge.jp/mailman/listinfo/groonga-commit >>> >> >> -- >> 結城 洋志 <YUKI Hiroshi> >> E-mail: yuki �� clear-code.com >> >> 株式会社クリアコード >> 〒113-0033 東京都文京区本郷3-27-12 >> 本郷デントビル2階 >> TEL : 03-6231-7270 >> FAX : 03-6231-7271 >> WWW : http://www.clear-code.com/ >> >> _______________________________________________ >> Groonga-commit mailing list >> Groonga-commit �� lists.sourceforge.jp >> http://lists.sourceforge.jp/mailman/listinfo/groonga-commit > > _______________________________________________ > Groonga-commit mailing list > Groonga-commit �� lists.sourceforge.jp > http://lists.sourceforge.jp/mailman/listinfo/groonga-commit > -- 結城 洋志 <YUKI Hiroshi> E-mail: yuki �� clear-code.com 株式会社クリアコード 〒113-0033 東京都文京区本郷3-27-12 本郷デントビル2階 TEL : 03-6231-7270 FAX : 03-6231-7271 WWW : http://www.clear-code.com/