[Groonga-commit] long-long-float/droonga-engine at f5126b1 [master] Add "catalog.rb"

Back to archive index

long-long-float null+****@clear*****
Wed Aug 20 13:19:05 JST 2014


long-long-float	2014-08-20 13:19:05 +0900 (Wed, 20 Aug 2014)

  New Revision: f5126b10992861f209e81c7892d3765b3c41a08c
  https://github.com/long-long-float/droonga-engine/commit/f5126b10992861f209e81c7892d3765b3c41a08c

  Merged c84abd0: Merge pull request #8 from long-long-float/add-catalog-plugin

  Message:
    Add "catalog.rb"

  Added files:
    lib/droonga/plugins/catalog.rb

  Added: lib/droonga/plugins/catalog.rb (+39 -0) 100644
===================================================================
--- /dev/null
+++ lib/droonga/plugins/catalog.rb    2014-08-20 13:19:05 +0900 (b9c32c6)
@@ -0,0 +1,39 @@
+# Copyright (C) 2013-2014 Droonga Project
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1 as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+require "droonga/plugin"
+
+module Droonga
+  module Plugins
+    module Catalog
+      extend Plugin
+      register("catalog")
+
+      class FetchHandler < Droonga::Handler
+        action.synchronous = false
+
+        def handle(message)
+          JSON.parse(Path.catalog.read)
+        end
+      end
+
+      define_single_step do |step|
+        step.name = "catalog.fetch"
+        step.handler = FetchHandler
+        step.collector = Collectors::Or
+      end
+    end
+  end
+end
-------------- next part --------------
HTML����������������������������...
下載 



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