[Groonga-commit] droonga/droonga-client-ruby at 0434f43 [master] Fixup missing fields and validate them for droogna-send command

Back to archive index

Kouhei Sutou kou****@clear*****
Thu Jan 15 14:43:39 JST 2015


> +  request_message = perfector.perfect(request_message)
> +  validator.validate(request_message)

perfectにした後にvalidateするのっておかしくないですか?
perfectにしたら必ずvalidationが通りそうなので、する意味がな
さそうに思います。

あと、このコミットじゃないですけど、
perfector.perfect(request_message)はrequest_messsageを破壊的
に変更しないほうがいいと思いました。

In <0434f43f27809dd625dcecfded3f59048339faea �� jenkins.clear-code.com>
  "[Groonga-commit] droonga/droonga-client-ruby �� 0434f43 [master] Fixup missing fields and validate them for droogna-send command" on Thu, 15 Jan 2015 14:35:42 +0900,
  YUKI Hiroshi <null+groonga �� clear-code.com> wrote:

> YUKI Hiroshi	2015-01-15 14:35:42 +0900 (Thu, 15 Jan 2015)
> 
>   New Revision: 0434f43f27809dd625dcecfded3f59048339faea
>   https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea
> 
>   Message:
>     Fixup missing fields and validate them for droogna-send command
> 
>   Modified files:
>     bin/droonga-send
> 
>   Modified: bin/droonga-send (+7 -0)
> ===================================================================
> --- bin/droonga-send    2015-01-15 14:34:21 +0900 (0442383)
> +++ bin/droonga-send    2015-01-15 14:35:42 +0900 (0dc032f)
> @@ -21,6 +21,8 @@ require "yajl"
>  require "json"
>  
>  require "droonga/client"
> +require "droonga/client/message_perfector"
> +require "droonga/client/message_validator"
>  
>  options = OpenStruct.new
>  options.report_request = false
> @@ -33,6 +35,9 @@ servers = []
>  default_server = "droonga:localhost:10031/droonga"
>  messages_per_second = Droonga::Client::RateLimiter::DEFAULT_LIMIT
>  
> +perfector = Droonga::Client::MessagePerfector.new
> +validator = Droonga::Client::MessageValidator.new
> +
>  def parse_server(server, options)
>    server_matcher = /\A(?:(droonga|http):)?([^:]+)(?::([0-9]+))?(?:\/(.+))?\z/
>    server =~ server_matcher
> @@ -167,6 +172,8 @@ json_parser.on_parse_complete = lambda do |request_message|
>      message << "\n"
>      print(message)
>    end
> +  request_message = perfector.perfect(request_message)
> +  validator.validate(request_message)
>    client = clients[client_index]
>    client.send(request_message)
>    client_index = (client_index + 1) % clients.size




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