<!DOCTYPE html>
<html>
<head>
</head>
<body>
<dl style="line-height: 1.5; margin-left: 2em">
<dt style="clear: both; float: left; font-weight: bold; width: 8em">Author</dt>
<dd style="margin-left: 8.5em">YUKI Hiroshi <shimo****@clear*****></dd>
<dt style="clear: both; float: left; font-weight: bold; width: 8em">Date</dt>
<dd style="margin-left: 8.5em">2015-01-15 14:35:42 +0900 (Thu, 15 Jan 2015)</dd>
<dt style="clear: both; float: left; font-weight: bold; width: 8em">New Revision</dt>
<dd style="margin-left: 8.5em"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea">0434f43f27809dd625dcecfded3f59048339faea</a></dd>
<dt style="clear: both; float: left; font-weight: bold; width: 8em">Message</dt>
<dd style="margin-left: 8.5em"><pre style="border: 1px solid #aaa; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; padding: 0.5em; width: auto">Fixup missing fields and validate them for droogna-send command</pre></dd>
<dt style="clear: both; float: left; font-weight: bold; width: 8em">Modified files</dt>
<dd style="margin-left: 8.5em">
<ul>
<li><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#diff-0">bin/droonga-send</a></li>
</ul>
</dd>
</dl>
<div class="diff-section" style="clear: both">
<table style="border-collapse: collapse; border: 1px solid #aaa">
<thead>
<tr class="diff-header" style="border: 1px solid #aaa">
<td colspan="3">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre"> Modified: bin/droonga-send (+7 -0)</span>
<span class="diff-header-mark" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">===================================================================</span>
</pre>
</td>
</tr>
</thead>
<tbody>
<tr>
<th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0L20">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0L21">21</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0L22">22</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0L23">23</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0L24">24</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0L25">25</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0L26">26</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0L32">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0L33">33</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0L34">34</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0L35">35</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0L36">36</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0L37">37</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0L38">38</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0L166">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0L167">167</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0L168">168</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0L169">169</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0L170">170</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0L171">171</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0L172">172</a></span>
</pre>
</th>
<th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R20">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R21">21</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R22">22</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R23">23</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R24">24</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R25">25</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R26">26</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R27">27</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R28">28</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R34">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R35">35</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R36">36</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R37">37</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R38">38</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R39">39</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R40">40</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R41">41</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R42">42</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R43">43</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R171">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R172">172</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R173">173</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R174">174</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R175">175</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R176">176</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R177">177</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R178">178</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga-client-ruby/commit/0434f43f27809dd625dcecfded3f59048339faea#L0R179">179</a></span>
</pre>
</th>
<td class="diff-content" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -21,6 +21,8 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">require "yajl"</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre"> require "json"</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
<span class="diff-not-changed" style="display: block; white-space: pre"> require "droonga/client"</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+require "droonga/client/message_perfector"</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+require "droonga/client/message_validator"</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
<span class="diff-not-changed" style="display: block; white-space: pre"> options = OpenStruct.new</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> options.report_request = false</span>
<span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -33,6 +35,9 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">servers = []</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre"> default_server = "droonga:localhost:10031/droonga"</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> messages_per_second = Droonga::Client::RateLimiter::DEFAULT_LIMIT</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+perfector = Droonga::Client::MessagePerfector.new</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+validator = Droonga::Client::MessageValidator.new</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> def parse_server(server, options)</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> server_matcher = /\A(?:(droonga|http):)?([^:]+)(?::([0-9]+))?(?:\/(.+))?\z/</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> server =~ server_matcher</span>
<span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -167,6 +172,8 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">json_parser.on_parse_complete = lambda do |request_message|</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre"> message << "\n"</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> print(message)</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> end</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ request_message = perfector.perfect(request_message)</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ validator.validate(request_message)</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> client = clients[client_index]</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> client.send(request_message)</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> client_index = (client_index + 1) % clients.size</span>
</pre>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>