[Groonga-commit] droonga/fluent-plugin-droonga at e54c148 [master] Move plugins to under plugin/#{type}/

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Nov 20 16:09:28 JST 2013


Kouhei Sutou	2013-11-20 16:09:28 +0900 (Wed, 20 Nov 2013)

  New Revision: e54c1489f956010425b774832e8b2c0e7ba885f1
  https://github.com/droonga/fluent-plugin-droonga/commit/e54c1489f956010425b774832e8b2c0e7ba885f1

  Message:
    Move plugins to under plugin/#{type}/
    
    lib/droonga/plugin/#{type}_#{name}.rb ->
    lib/droonga/plugin/#{type}/#{name}.rb
                              ^

  Modified files:
    lib/droonga/plugin.rb
    test/plugin/handler/test_handler_add.rb
    test/plugin/handler/test_handler_groonga.rb
    test/plugin/handler/test_handler_search.rb
    test/plugin/handler/test_handler_watch.rb
  Renamed files:
    lib/droonga/plugin/adapter/groonga.rb
      (from lib/droonga/plugin/adapter_groonga.rb)
    lib/droonga/plugin/handler/add.rb
      (from lib/droonga/plugin/handler_add.rb)
    lib/droonga/plugin/handler/collector.rb
      (from lib/droonga/plugin/handler_collector.rb)
    lib/droonga/plugin/handler/forward.rb
      (from lib/droonga/plugin/handler_forward.rb)
    lib/droonga/plugin/handler/groonga.rb
      (from lib/droonga/plugin/handler_groonga.rb)
    lib/droonga/plugin/handler/search.rb
      (from lib/droonga/plugin/handler_search.rb)
    lib/droonga/plugin/handler/watch.rb
      (from lib/droonga/plugin/handler_watch.rb)

  Modified: lib/droonga/plugin.rb (+9 -5)
===================================================================
--- lib/droonga/plugin.rb    2013-11-20 16:07:28 +0900 (746bf7c)
+++ lib/droonga/plugin.rb    2013-11-20 16:09:28 +0900 (8c47906)
@@ -20,10 +20,14 @@ module Droonga
     class << self
       def load_all
         $LOAD_PATH.each do |load_path|
-          Dir.glob("#{load_path}/droonga/plugin/*_*.rb") do |path|
-            type, name = File.basename(path, ".rb").split(/_/, 2)
-            plugin = new(type, name)
-            plugin.load
+          Dir.glob("#{load_path}/droonga/plugin/*") do |type_path|
+            next unless File.directory?(type_path)
+            type = File.basename(type_path)
+            Dir.glob("#{type_path}/*.rb") do |path|
+              name = File.basename(path, ".rb")
+              plugin = new(type, name)
+              plugin.load
+            end
           end
         end
       end
@@ -35,7 +39,7 @@ module Droonga
     end
 
     def load
-      require "droonga/plugin/#{@type}_#{@name}"
+      require "droonga/plugin/#{@type}/#{@name}"
     end
   end
 end

  Renamed: lib/droonga/plugin/adapter/groonga.rb (+0 -0) 100%
===================================================================

  Renamed: lib/droonga/plugin/handler/add.rb (+0 -0) 100%
===================================================================

  Renamed: lib/droonga/plugin/handler/collector.rb (+0 -0) 100%
===================================================================

  Renamed: lib/droonga/plugin/handler/forward.rb (+0 -0) 100%
===================================================================

  Renamed: lib/droonga/plugin/handler/groonga.rb (+0 -0) 100%
===================================================================

  Renamed: lib/droonga/plugin/handler/search.rb (+0 -0) 100%
===================================================================

  Renamed: lib/droonga/plugin/handler/watch.rb (+0 -0) 100%
===================================================================

  Modified: test/plugin/handler/test_handler_add.rb (+1 -1)
===================================================================
--- test/plugin/handler/test_handler_add.rb    2013-11-20 16:07:28 +0900 (782a153)
+++ test/plugin/handler/test_handler_add.rb    2013-11-20 16:09:28 +0900 (3945a68)
@@ -13,7 +13,7 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-require "droonga/plugin/handler_add"
+require "droonga/plugin/handler/add"
 
 class AddHandlerTest < Test::Unit::TestCase
   def setup

  Modified: test/plugin/handler/test_handler_groonga.rb (+1 -1)
===================================================================
--- test/plugin/handler/test_handler_groonga.rb    2013-11-20 16:07:28 +0900 (11f1b7c)
+++ test/plugin/handler/test_handler_groonga.rb    2013-11-20 16:09:28 +0900 (34d19fb)
@@ -13,7 +13,7 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-require "droonga/plugin/handler_groonga"
+require "droonga/plugin/handler/groonga"
 
 class GroongaHandlerTest < Test::Unit::TestCase
   include HandlerHelper

  Modified: test/plugin/handler/test_handler_search.rb (+1 -1)
===================================================================
--- test/plugin/handler/test_handler_search.rb    2013-11-20 16:07:28 +0900 (2dbb965)
+++ test/plugin/handler/test_handler_search.rb    2013-11-20 16:09:28 +0900 (bacb90d)
@@ -13,7 +13,7 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-require "droonga/plugin/handler_search"
+require "droonga/plugin/handler/search"
 
 class SearchHandlerTest < Test::Unit::TestCase
   include HandlerHelper

  Modified: test/plugin/handler/test_handler_watch.rb (+1 -1)
===================================================================
--- test/plugin/handler/test_handler_watch.rb    2013-11-20 16:07:28 +0900 (a998179)
+++ test/plugin/handler/test_handler_watch.rb    2013-11-20 16:09:28 +0900 (bda2201)
@@ -15,7 +15,7 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-require "droonga/plugin/handler_watch"
+require "droonga/plugin/handler/watch"
 
 class WatchHandlerTest < Test::Unit::TestCase
   include WatchHelper
-------------- next part --------------
HTML����������������������������...
Download 



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