YUKI Hiroshi
null+****@clear*****
Fri May 29 17:43:39 JST 2015
YUKI Hiroshi 2015-05-29 17:43:39 +0900 (Fri, 29 May 2015) New Revision: 7dc52a004281cf2070cfd5ccc4204b30b1511ccf https://github.com/droonga/droonga-client-ruby/commit/7dc52a004281cf2070cfd5ccc4204b30b1511ccf Message: Support dry-run Modified files: bin/droonga-add bin/droonga-system-status Modified: bin/droonga-add (+5 -3) =================================================================== --- bin/droonga-add 2015-05-29 17:43:06 +0900 (d10a567) +++ bin/droonga-add 2015-05-29 17:43:39 +0900 (2618f5a) @@ -52,10 +52,12 @@ module Droonga puts "Adding new record..." puts(JSON.pretty_generate(add_params)) - response = request(add_message) - raise NoResponse.new unless response + result = request(add_message) do |response| + raise NoResponse.new unless response + response["body"] + end - if response["body"] + if result puts "Done." true else Modified: bin/droonga-system-status (+12 -8) =================================================================== --- bin/droonga-system-status 2015-05-29 17:43:06 +0900 (2674361) +++ bin/droonga-system-status 2015-05-29 17:43:39 +0900 (b4ef0d3) @@ -29,15 +29,19 @@ module Droonga :default => false) end - response = request("dataset" => @options[:dataset], - "type" => "system.status") - raise NoResponse.new unless response - body = response["body"] + system_status_message = { + "dataset" => @options[:dataset], + "type" => "system.status", + } + request(system_status_message) do |response| + raise NoResponse.new unless response + body = response["body"] - if @options[:pretty] - puts(JSON.pretty_generate(body)) - else - puts(JSON.generate(body)) + if @options[:pretty] + puts(JSON.pretty_generate(body)) + else + puts(JSON.generate(body)) + end end true -------------- next part -------------- HTML����������������������������...Download