[Groonga-commit] droonga/fluent-plugin-droonga at 9bec21d [master] Remove unused code

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Feb 28 10:46:01 JST 2014


Kouhei Sutou	2014-02-28 10:46:01 +0900 (Fri, 28 Feb 2014)

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

  Message:
    Remove unused code

  Modified files:
    lib/droonga/plugin_loader.rb

  Modified: lib/droonga/plugin_loader.rb (+5 -22)
===================================================================
--- lib/droonga/plugin_loader.rb    2014-02-28 10:12:49 +0900 (fd3f047)
+++ lib/droonga/plugin_loader.rb    2014-02-28 10:46:01 +0900 (d8dc831)
@@ -25,26 +25,11 @@ module Droonga
         loading = nil
         begin
           $LOAD_PATH.each do |load_path|
-            pattern = "#{load_path}/droonga/plugin/*"
-            $log.debug("#{self.name}: finding plugins at #{pattern}")
-            Dir.glob(pattern) do |type_path|
-              next unless File.directory?(type_path)
-              type = File.basename(type_path)
-              Dir.glob("#{type_path}/*.rb") do |path|
-                loading = path
-                name = File.basename(path, ".rb")
-                loader = new(type, name)
-                loader.load
-                loaded << path
-              end
-            end
-
             Pathname.glob("#{load_path}/droonga/plugins/*.rb") do |plugin_path|
               loading = plugin_path
-              relative_plugin_path =
-                plugin_path.relative_path_from(Pathname(load_path))
-              require_path = relative_plugin_path.to_s.gsub(/\.rb\z/, "")
-              require require_path
+              name = Pathname(plugin_path).basename(".rb").to_s
+              loader = new(name)
+              loader.load
               loaded << plugin_path
             end
           end
@@ -57,14 +42,12 @@ module Droonga
       end
     end
 
-    def initialize(type, name)
-      @type = type
+    def initialize(name)
       @name = name
     end
 
     def load
-      return if @type == "metadata"
-      require "droonga/plugin/#{@type}/#{@name}"
+      require "droonga/plugins/#{@name}"
     end
   end
 end
-------------- next part --------------
HTML����������������������������...
Download 



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