[Groonga-commit] droonga/droonga-engine at 3c4d232 [buffered-forward] Accept parsed catalog as the source of CatalogModifier

Back to archive index

YUKI Hiroshi null+****@clear*****
Tue Mar 24 13:00:58 JST 2015


YUKI Hiroshi	2015-03-24 13:00:58 +0900 (Tue, 24 Mar 2015)

  New Revision: 3c4d232e60ac7ceb7507b383ddd35b08ce761a25
  https://github.com/droonga/droonga-engine/commit/3c4d232e60ac7ceb7507b383ddd35b08ce761a25

  Message:
    Accept parsed catalog as the source of CatalogModifier

  Modified files:
    lib/droonga/catalog_modifier.rb

  Modified: lib/droonga/catalog_modifier.rb (+4 -4)
===================================================================
--- lib/droonga/catalog_modifier.rb    2015-03-23 20:02:12 +0900 (e747c9b)
+++ lib/droonga/catalog_modifier.rb    2015-03-24 13:00:58 +0900 (fbcbdc4)
@@ -22,16 +22,16 @@ require "droonga/safe_file_writer"
 module Droonga
   class CatalogModifier
     class << self
-      def modify
-        new.modify do |generator, file|
+      def modify(source_catalog=nil)
+        new(source_catalog).modify do |generator, file|
           yield(generator, file)
         end
       end
     end
 
-    def initialize
+    def initialize(source_catalog=nil)
       @generator = CatalogGenerator.new
-      @catalog = JSON.parse(Path.catalog.read)
+      @catalog = source_catalog || JSON.parse(Path.catalog.read)
       @generator.load(@catalog)
     end
 
-------------- next part --------------
HTML����������������������������...
Download 



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