Kouhei Sutou
null+****@clear*****
Fri Nov 22 17:25:53 JST 2013
Kouhei Sutou 2013-11-22 17:25:53 +0900 (Fri, 22 Nov 2013) New Revision: 3a4c933abd0a2b9a5d8843cc0c216346345bf0d9 https://github.com/droonga/fluent-plugin-droonga/commit/3a4c933abd0a2b9a5d8843cc0c216346345bf0d9 Message: Expose PluginRepository "Droonga::HandlerPlugin.repository.register" will be shorter soon. Modified files: lib/droonga/adapter.rb lib/droonga/dispatcher.rb lib/droonga/executor.rb lib/droonga/handler_plugin.rb lib/droonga/plugin/adapter/groonga.rb lib/droonga/plugin/handler/add.rb lib/droonga/plugin/handler/collector.rb lib/droonga/plugin/handler/forward.rb lib/droonga/plugin/handler/groonga.rb lib/droonga/plugin/handler/search.rb lib/droonga/plugin/handler/watch.rb Modified: lib/droonga/adapter.rb (+1 -1) =================================================================== --- lib/droonga/adapter.rb 2013-11-22 17:08:41 +0900 (c9aa279) +++ lib/droonga/adapter.rb 2013-11-22 17:25:53 +0900 (955462f) @@ -50,7 +50,7 @@ module Droonga end class BasicAdapter < Adapter - Droonga::HandlerPlugin.register("adapter", self) + Droonga::HandlerPlugin.repository.register("adapter", self) command :table_create def table_create(request) Modified: lib/droonga/dispatcher.rb (+1 -1) =================================================================== --- lib/droonga/dispatcher.rb 2013-11-22 17:08:41 +0900 (4f7766e) +++ lib/droonga/dispatcher.rb 2013-11-22 17:25:53 +0900 (5683742) @@ -248,7 +248,7 @@ module Droonga end class DispatcherMessageHandler < Droonga::Handler - Droonga::HandlerPlugin.register("dispatcher_message", self) + Droonga::HandlerPlugin.repository.register("dispatcher_message", self) def initialize(*arguments) super @dispatcher = Droonga::Dispatcher.new(@worker, @worker.name) Modified: lib/droonga/executor.rb (+1 -1) =================================================================== --- lib/droonga/executor.rb 2013-11-22 17:08:41 +0900 (a7f8320) +++ lib/droonga/executor.rb 2013-11-22 17:25:53 +0900 (1d3dd1b) @@ -63,7 +63,7 @@ module Droonga end def add_handler(name) - handler = HandlerPlugin.instantiate(name, self) + handler = HandlerPlugin.repository.instantiate(name, self) @handlers << handler end Modified: lib/droonga/handler_plugin.rb (+2 -6) =================================================================== --- lib/droonga/handler_plugin.rb 2013-11-22 17:08:41 +0900 (b322cdd) +++ lib/droonga/handler_plugin.rb 2013-11-22 17:25:53 +0900 (a1571ed) @@ -22,12 +22,8 @@ module Droonga @@repository = PluginRepository.new class << self - def register(name, handler_class) - @@repository.register(name, handler_class) - end - - def instantiate(name, *args, &block) - @@repository.instantiate(name, *args, &block) + def repository + @@repository end end end Modified: lib/droonga/plugin/adapter/groonga.rb (+1 -1) =================================================================== --- lib/droonga/plugin/adapter/groonga.rb 2013-11-22 17:08:41 +0900 (8a0b2b6) +++ lib/droonga/plugin/adapter/groonga.rb 2013-11-22 17:25:53 +0900 (130e670) @@ -20,7 +20,7 @@ require "droonga/adapter" module Droonga class GroongaAdapter < Droonga::Adapter # TODO: AdapterPlugin or something should be defined to avoid conflicts. - Droonga::HandlerPlugin.register("select", self) + Droonga::HandlerPlugin.repository.register("select", self) command :select def select(select_request) command = Select.new Modified: lib/droonga/plugin/handler/add.rb (+1 -1) =================================================================== --- lib/droonga/plugin/handler/add.rb 2013-11-22 17:08:41 +0900 (b090778) +++ lib/droonga/plugin/handler/add.rb 2013-11-22 17:25:53 +0900 (ea64921) @@ -21,7 +21,7 @@ require "droonga/handler" module Droonga class AddHandler < Droonga::Handler - Droonga::HandlerPlugin.register("add", self) + Droonga::HandlerPlugin.repository.register("add", self) command :add def add(request) Modified: lib/droonga/plugin/handler/collector.rb (+1 -1) =================================================================== --- lib/droonga/plugin/handler/collector.rb 2013-11-22 17:08:41 +0900 (e8993f8) +++ lib/droonga/plugin/handler/collector.rb 2013-11-22 17:25:53 +0900 (9dd4fb2) @@ -20,7 +20,7 @@ require "droonga/searcher" module Droonga class BasicCollectorHandler < Droonga::CollectorHandler - Droonga::HandlerPlugin.register("collector", self) + Droonga::HandlerPlugin.repository.register("collector", self) command :collector_gather def collector_gather(request) Modified: lib/droonga/plugin/handler/forward.rb (+1 -1) =================================================================== --- lib/droonga/plugin/handler/forward.rb 2013-11-22 17:08:41 +0900 (71088d4) +++ lib/droonga/plugin/handler/forward.rb 2013-11-22 17:25:53 +0900 (8b047c0) @@ -20,7 +20,7 @@ require "droonga/logger" module Droonga class MergeHandler < Droonga::Handler - Droonga::HandlerPlugin.register("forward", self) + Droonga::HandlerPlugin.repository.register("forward", self) CONFIG_FILE_PATH = 'config.json' Modified: lib/droonga/plugin/handler/groonga.rb (+1 -1) =================================================================== --- lib/droonga/plugin/handler/groonga.rb 2013-11-22 17:08:41 +0900 (301569e) +++ lib/droonga/plugin/handler/groonga.rb 2013-11-22 17:25:53 +0900 (6ddeb3c) @@ -21,7 +21,7 @@ require "droonga/handler" module Droonga class GroongaHandler < Droonga::Handler - Droonga::HandlerPlugin.register("groonga", self) + Droonga::HandlerPlugin.repository.register("groonga", self) command :table_create def table_create(request) Modified: lib/droonga/plugin/handler/search.rb (+1 -1) =================================================================== --- lib/droonga/plugin/handler/search.rb 2013-11-22 17:08:41 +0900 (da6dd5a) +++ lib/droonga/plugin/handler/search.rb 2013-11-22 17:25:53 +0900 (e8964b3) @@ -20,7 +20,7 @@ require "droonga/searcher" module Droonga class SearchHandler < Droonga::Handler - Droonga::HandlerPlugin.register("search", self) + Droonga::HandlerPlugin.repository.register("search", self) command :search def search(request) Modified: lib/droonga/plugin/handler/watch.rb (+1 -1) =================================================================== --- lib/droonga/plugin/handler/watch.rb 2013-11-22 17:08:41 +0900 (7b8d83c) +++ lib/droonga/plugin/handler/watch.rb 2013-11-22 17:25:53 +0900 (1ba661c) @@ -22,7 +22,7 @@ require "droonga/handler" module Droonga class WatchHandler < Droonga::Handler - Droonga::HandlerPlugin.register("watch", self) + Droonga::HandlerPlugin.repository.register("watch", self) def initialize(*args) super -------------- next part -------------- HTML����������������������������...Download