[Groonga-commit] droonga/fluent-plugin-droonga at 087b041 [master] Resolve base path by Catalog itself

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Feb 12 13:40:20 JST 2014


YUKI Hiroshi	2014-02-12 13:40:20 +0900 (Wed, 12 Feb 2014)

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

  Message:
    Resolve base path by Catalog itself

  Modified files:
    lib/droonga/catalog/base.rb
    lib/droonga/catalog_loader.rb

  Modified: lib/droonga/catalog/base.rb (+4 -3)
===================================================================
--- lib/droonga/catalog/base.rb    2014-02-12 13:27:15 +0900 (4d599fc)
+++ lib/droonga/catalog/base.rb    2014-02-12 13:40:20 +0900 (e30ae39)
@@ -20,10 +20,11 @@ require "droonga/message_processing_error"
 module Droonga
   module Catalog
     class Base
-      attr_reader :base_path
-      def initialize(data, base_path)
+      attr_reader :path, :base_path
+      def initialize(data, path)
         @data = data
-        @base_path = base_path
+        @path = path
+        @base_path = File.dirname(base_path)
 
         @data["datasets"].each do |name, dataset|
           number_of_partitions = dataset["number_of_partitions"]

  Modified: lib/droonga/catalog_loader.rb (+1 -1)
===================================================================
--- lib/droonga/catalog_loader.rb    2014-02-12 13:27:15 +0900 (488c404)
+++ lib/droonga/catalog_loader.rb    2014-02-12 13:40:20 +0900 (3ee85ac)
@@ -27,7 +27,7 @@ module Droonga
       data = File.open(@path) do |file|
         JSON.parse(file.read)
       end
-      Catalog::Version1.new(data, File.dirname(@path))
+      Catalog::Version1.new(data, @path)
     rescue JSON::ParserError => error
       raise InvalidCatalog.new("Syntax error in #{@path}\n#{error.to_s}")
     end
-------------- next part --------------
HTML����������������������������...
Download 



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