YUKI Hiroshi
null+****@clear*****
Fri Apr 10 12:20:16 JST 2015
YUKI Hiroshi 2015-04-10 12:20:16 +0900 (Fri, 10 Apr 2015) New Revision: 0ebeb563395c53371a05eb7ba639d20f4fee9e1d https://github.com/droonga/drndump/commit/0ebeb563395c53371a05eb7ba639d20f4fee9e1d Message: Isolate Dumper from Coolio Modified files: lib/drndump/command.rb lib/drndump/dumper.rb Modified: lib/drndump/command.rb (+5 -1) =================================================================== --- lib/drndump/command.rb 2015-04-10 12:17:37 +0900 (c726cf4) +++ lib/drndump/command.rb 2015-04-10 12:20:16 +0900 (0e4cf1c) @@ -110,7 +110,11 @@ module Drndump :tag => @tag, :receiver_host => @receiver_host, :receiver_port => @receiver_port) - @dumper.run(:loop => @loop) + client_options = { + :backend => :coolio, + :loop => @loop, + } + @dumper.run(:client_options => client_options) @loop.run @dumper.error_message end Modified: lib/drndump/dumper.rb (+5 -7) =================================================================== --- lib/drndump/dumper.rb 2015-04-10 12:17:37 +0900 (3782027) +++ lib/drndump/dumper.rb 2015-04-10 12:20:16 +0900 (3487bb3) @@ -16,12 +16,8 @@ require "socket" require "json" -require "cool.io" - require "droonga/client" -require "drndump/version" - module Drndump class Dumper attr_reader :error_message @@ -36,8 +32,9 @@ module Drndump @receiver_port = params[:receiver_port] || 0 end - def run(loop) - client = Droonga::Client.new(client_options.merge(:loop => loop)) + def run(options={}) + extra_client_options = options[:client_options] || {} + client = Droonga::Client.new(client_options.merge(extra_client_options)) @error_message = nil n_dumpers = 0 @@ -78,6 +75,8 @@ module Drndump end end end + + @error_message end private @@ -89,7 +88,6 @@ module Drndump :protocol => :droonga, :receiver_host => @receiver_host, :receiver_port => @receiver_port, - :backend => :coolio, } end -------------- next part -------------- HTML����������������������������... 下载