Kenji Okimoto
okimo****@clear*****
Tue Feb 18 10:13:18 JST 2014
今さらかもしれませんが。。。 http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1 > - STATUS_CODE = STATUS_INTERNAL_ERROR > + STATUS_CODE = StatusCode::INTERNAL_ERROR RFCに合わせて INTERNAL_SERVER_ERROR にした方がいいと思いました。 (2014年02月17日 17:54), Kouhei Sutou wrote: > Author > Kouhei Sutou <kou �� clear-code.com> > Date > 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 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#diff-0> > * lib/droonga/replier.rb <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#diff-1> > * lib/droonga/status_code.rb <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#diff-2> > > Modified: lib/droonga/message_processing_error.rb (+3 -3) > =================================================================== > > @@ -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) > =================================================================== > > ... <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L1L25> > 26 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L1L26> > 27 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L1L27> > 28 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L1L28> > 29 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L1L29> > > 30 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L1L30> > 31 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L1L31> > 32 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L1L32> > > > > ... <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L1R25> > 26 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L1R26> > 27 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L1R27> > 28 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L1R28> > > 29 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L1R29> > 30 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L1R30> > 31 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L1R31> > 32 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L1R32> > > > > @@ -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) > =================================================================== > > ... <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L2L15> > 16 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L2L16> > 17 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L2L17> > 18 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L2L18> > 19 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L2L19> > 20 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L2L20> > 21 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L2L21> > 22 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L2L22> > > > > > > > 23 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L2L23> > > > > ... <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L2R15> > 16 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L2R16> > 17 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L2R17> > 18 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L2R18> > > > > > 19 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L2R19> > 20 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L2R20> > 21 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L2R21> > 22 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L2R22> > 23 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L2R23> > 24 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L2R24> > 25 <https://github.com/droonga/fluent-plugin-droonga/commit/b4fd0b902453606b59f979df27ab654c559a391a#L2R25> > > > > @@ -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 > > > > _______________________________________________ > Groonga-commit mailing list > Groonga-commit �� lists.sourceforge.jp > http://lists.sourceforge.jp/mailman/listinfo/groonga-commit > -- Kenji Okimoto <okimoto �� clear-code.com>