[Groonga-commit] droonga/fluent-plugin-droonga at b4fd0b9 [master] Introduce StatusCode module as namespace

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Feb 17 17:54:04 JST 2014


Kouhei Sutou	2014-02-17 17:54:04 +0900 (Mon, 17 Feb 2014)

  New Revision: b4fd0b902453606b59f979df27ab654c559a391a
  https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a

  Message:
    Introduce StatusCode module as namespace

  Modified files:
    lib/droonga/message_processing_error.rb
    lib/droonga/replier.rb
    lib/droonga/status_code.rb

  Modified: lib/droonga/message_processing_error.rb (+3 -3)
===================================================================
--- lib/droonga/message_processing_error.rb    2014-02-17 17:51:52 +0900 (90955ef)
+++ lib/droonga/message_processing_error.rb    2014-02-17 17:54:04 +0900 (cf3f5d1)
@@ -18,7 +18,7 @@ require "droonga/status_code"
 
 module Droonga
   class MessageProcessingError < Error
-    STATUS_CODE = STATUS_INTERNAL_ERROR
+    STATUS_CODE = StatusCode::INTERNAL_ERROR
 
     attr_reader :message, :detail
 
@@ -46,10 +46,10 @@ module Droonga
   end
 
   class BadRequest < MessageProcessingError
-    STATUS_CODE = STATUS_BAD_REQUEST
+    STATUS_CODE = StatusCode::BAD_REQUEST
   end
 
   class NotFound < MessageProcessingError
-    STATUS_CODE = STATUS_NOT_FOUND
+    STATUS_CODE = StatusCode::NOT_FOUND
   end
 end

  Modified: lib/droonga/replier.rb (+1 -1)
===================================================================
--- lib/droonga/replier.rb    2014-02-17 17:51:52 +0900 (6bd8099)
+++ lib/droonga/replier.rb    2014-02-17 17:54:04 +0900 (5bebf3d)
@@ -26,7 +26,7 @@ module Droonga
       destination = message["replyTo"]
       reply_message = {
         "inReplyTo"  => message["id"],
-        "statusCode" => message["statusCode"] || STATUS_OK,
+        "statusCode" => message["statusCode"] || StatusCode::OK,
         "type"       => destination["type"],
         "body"       => message["body"],
       }

  Modified: lib/droonga/status_code.rb (+6 -4)
===================================================================
--- lib/droonga/status_code.rb    2014-02-17 17:51:52 +0900 (bf02572)
+++ lib/droonga/status_code.rb    2014-02-17 17:54:04 +0900 (da6d2e7)
@@ -16,8 +16,10 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 module Droonga
-  STATUS_OK             = 200
-  STATUS_BAD_REQUEST    = 400
-  STATUS_NOT_FOUND      = 404
-  STATUS_INTERNAL_ERROR = 500
+  module StatusCode
+    OK             = 200
+    BAD_REQUEST    = 400
+    NOT_FOUND      = 404
+    INTERNAL_ERROR = 500
+  end
 end
-------------- next part --------------
HTML����������������������������...
Download 



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