[Groonga-commit] droonga/express-droonga at 22a5d9b [master] Shorten command type name

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Dec 16 14:28:09 JST 2013


YUKI Hiroshi	2013-12-16 14:28:09 +0900 (Mon, 16 Dec 2013)

  New Revision: 22a5d9b1c2bd00f9195de17c3f0384b4404c7598
  https://github.com/droonga/express-droonga/commit/22a5d9b1c2bd00f9195de17c3f0384b4404c7598

  Message:
    Shorten command type name
    
    RequestResponseHTTPCommand =>
    HTTPRequestResponse

  Modified files:
    lib/adapter/api/droonga.js
    lib/adapter/api/groonga.js
    lib/adapter/api/rest.js
    lib/adapter/command.js
    test/adapter/rest.test.js
    test/adapter/socket.io.test.js
    test/express-adapter.test.js

  Modified: lib/adapter/api/droonga.js (+1 -1)
===================================================================
--- lib/adapter/api/droonga.js    2013-12-16 14:24:50 +0900 (28c5936)
+++ lib/adapter/api/droonga.js    2013-12-16 14:28:09 +0900 (711a74c)
@@ -2,7 +2,7 @@ var command = require('../command');
 
 module.exports = {
   // XXX dangerous! this must be disabled on public services.
-  'droonga': new command.RequestResponseHTTPCommand({
+  'droonga': new command.HTTPRequestResponse({
     method: 'POST',
     path: '/droonga/:messageType',
     onRequest: function(request, connection) {

  Modified: lib/adapter/api/groonga.js (+1 -1)
===================================================================
--- lib/adapter/api/groonga.js    2013-12-16 14:24:50 +0900 (2578168)
+++ lib/adapter/api/groonga.js    2013-12-16 14:28:09 +0900 (43d501e)
@@ -1,7 +1,7 @@
 var command = require('../command');
 
 module.exports = {
-  'groonga': new command.RequestResponseHTTPCommand({
+  'groonga': new command.HTTPRequestResponse({
     path: '/d/:commandName',
     onRequest: function(request, connection) {
       connection.emit(request.params.commandName, request.query);

  Modified: lib/adapter/api/rest.js (+8 -8)
===================================================================
--- lib/adapter/api/rest.js    2013-12-16 14:24:50 +0900 (404bc89)
+++ lib/adapter/api/rest.js    2013-12-16 14:28:09 +0900 (1a1f33e)
@@ -2,54 +2,54 @@ var command = require('../command');
 var requestBuilders = require('./rest-request-builder');
 
 module.exports = {
-//  'status': new command.RequestResponseHTTPCommand({
+//  'status': new command.HTTPRequestResponse({
 //    path: '/status/:target',
 //    onRequest: function(request, connection) {
 //      connection.emit('status', requestBuilders.status(request));
 //    }
 //  }),
-  'search': new command.RequestResponseHTTPCommand({
+  'search': new command.HTTPRequestResponse({
     path: '/tables/:tableName',
     onRequest: function(request, connection) {
       connection.emit('search', requestBuilders.search(request));
     }
   }) //,
-//  'createtable': new command.RequestResponseHTTPCommand({
+//  'createtable': new command.HTTPRequestResponse({
 //    method: 'PUT',
 //    path: '/tables/:tableName',
 //    onRequest: function(request, connection) {
 //      connection.emit('createtable', requestBuilders.createTable(request));
 //    }
 //  }),
-//  'removetable': new command.RequestResponseHTTPCommand({
+//  'removetable': new command.HTTPRequestResponse({
 //    method: 'DELETE',
 //    path: '/tables/:tableName',
 //    onRequest: function(request, connection) {
 //      connection.emit('removetable', requestBuilders.removeTable(request));
 //    }
 //  }),
-//  'createcolumn': new command.RequestResponseHTTPCommand({
+//  'createcolumn': new command.HTTPRequestResponse({
 //    method: 'PUT',
 //    path: '/tables/:tableName/columns/:columnName',
 //    onRequest: function(request, connection) {
 //      connection.emit('createcolumn', requestBuilders.createColumn(request));
 //    }
 //  }),
-//  'removecolumn': new command.RequestResponseHTTPCommand({
+//  'removecolumn': new command.HTTPRequestResponse({
 //    method: 'DELETE',
 //    path: '/tables/:tableName/columns/:columnName',
 //    onRequest: function(request, connection) {
 //      connection.emit('removecolumn', requestBuilders.removeColumn(request));
 //    }
 //  }),
-//  'loadrecord': new command.RequestResponseHTTPCommand({
+//  'loadrecord': new command.HTTPRequestResponse({
 //    method: 'PUT',
 //    path: '/tables/:tableName/records/:key',
 //    onRequest: function(request, connection) {
 //      connection.emit('loadrecord', requestBuilders.loadRecord(request));
 //    }
 //  }),
-//  'loadrecords': new command.RequestResponseHTTPCommand({
+//  'loadrecords': new command.HTTPRequestResponse({
 //    method: 'PUT',
 //    path: '/tables/:tableName/records',
 //    onRequest: function(request, connection) {

  Modified: lib/adapter/command.js (+6 -6)
===================================================================
--- lib/adapter/command.js    2013-12-16 14:24:50 +0900 (7fbf1e3)
+++ lib/adapter/command.js    2013-12-16 14:28:09 +0900 (210c234)
@@ -87,15 +87,15 @@ exports.HTTPCommand = HTTPCommand;
 
 
 
-function RequestResponseHTTPCommand(options) {
+function HTTPRequestResponse(options) {
   HTTPCommand.apply(this, arguments);
-  this._commandTypes.push(RequestResponseHTTPCommand);
+  this._commandTypes.push(HTTPRequestResponse);
   this._commandTypes.push(RequestResponse);
 }
-util.inherits(RequestResponseHTTPCommand, HTTPCommand);
-util.inherits(RequestResponseHTTPCommand, RequestResponse);
-RequestResponseHTTPCommand.isInstance = HTTPCommand.isInstance;
-exports.RequestResponseHTTPCommand = RequestResponseHTTPCommand;
+util.inherits(HTTPRequestResponse, HTTPCommand);
+util.inherits(HTTPRequestResponse, RequestResponse);
+HTTPRequestResponse.isInstance = HTTPCommand.isInstance;
+exports.HTTPRequestResponse = HTTPRequestResponse;
 
 
 

  Modified: test/adapter/rest.test.js (+7 -7)
===================================================================
--- test/adapter/rest.test.js    2013-12-16 14:24:50 +0900 (50e5f90)
+++ test/adapter/rest.test.js    2013-12-16 14:28:09 +0900 (64b1d6e)
@@ -15,29 +15,29 @@ var groongaAPI = require('../../lib/adapter/api/groonga');
 suite('HTTP Adapter', function() {
   test('registeration of plugin commands', function() {
     var basePlugin = {
-      getCommand: new command.RequestResponseHTTPCommand({
+      getCommand: new command.HTTPRequestResponse({
         path: '/get'
       }),
-      putCommand: new command.RequestResponseHTTPCommand({
+      putCommand: new command.HTTPRequestResponse({
         method: 'PUT',
         path: '/put'
       }),
-      postCommand: new command.RequestResponseHTTPCommand({
+      postCommand: new command.HTTPRequestResponse({
         method: 'POST',
         path: '/post'
       }),
-      deleteCommand: new command.RequestResponseHTTPCommand({
+      deleteCommand: new command.HTTPRequestResponse({
         method: 'DELETE',
         path: '/delete'
       }),
       ignored: new command.SocketCommand()
     };
     var overridingPlugin = {
-      postCommand: new command.RequestResponseHTTPCommand({
+      postCommand: new command.HTTPRequestResponse({
         method: 'POST',
         path: '/post/overridden'
       }),
-      deleteCommand: new command.RequestResponseHTTPCommand({
+      deleteCommand: new command.HTTPRequestResponse({
         method: 'DELETE',
         path: '/delete/overridden'
       })
@@ -82,7 +82,7 @@ suite('HTTP Adapter', function() {
 
   suite('registeration', function() {
     var testPlugin = {
-      adapter: new command.RequestResponseHTTPCommand({
+      adapter: new command.HTTPRequestResponse({
         path: '/path/to/adapter',
         onRequest: function(request, connection) {
           connection.emit('adapter', 'adapter requested');

  Modified: test/adapter/socket.io.test.js (+1 -1)
===================================================================
--- test/adapter/socket.io.test.js    2013-12-16 14:24:50 +0900 (478c310)
+++ test/adapter/socket.io.test.js    2013-12-16 14:28:09 +0900 (7c2f3fa)
@@ -92,7 +92,7 @@ suite('Socket.IO Adapter', function() {
       putCommand: new command.SocketRequestResponse(),
       postCommand: new command.SocketRequestResponse(),
       deleteCommand: new command.SocketRequestResponse(),
-      ignored: new command.RequestResponseHTTPCommand()
+      ignored: new command.HTTPRequestResponse()
     };
     var overridingPlugin = {
       postCommand: new command.SocketRequestResponse(),

  Modified: test/express-adapter.test.js (+1 -1)
===================================================================
--- test/express-adapter.test.js    2013-12-16 14:24:50 +0900 (40690f5)
+++ test/express-adapter.test.js    2013-12-16 14:28:09 +0900 (1f51bb7)
@@ -10,7 +10,7 @@ var command = require('../lib/adapter/command');
 
 suite('Adaption for express application', function() {
   var testRestPlugin = {
-    api: new command.RequestResponseHTTPCommand({
+    api: new command.HTTPRequestResponse({
       path: '/path/to/api',
       onRequest: function(request, connection) {
         connection.emit('api', 'api requested');
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index