[Groonga-commit] droonga/fluent-plugin-droonga at 72e5f80 [master] Split method to get path to the catalog file

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Sep 27 18:01:15 JST 2013


YUKI Hiroshi	2013-09-27 18:01:15 +0900 (Fri, 27 Sep 2013)

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

  Message:
    Split method to get path to the catalog file

  Modified files:
    lib/droonga/catalog.rb

  Modified: lib/droonga/catalog.rb (+6 -2)
===================================================================
--- lib/droonga/catalog.rb    2013-09-27 17:52:27 +0900 (a29b80a)
+++ lib/droonga/catalog.rb    2013-09-27 18:01:15 +0900 (05f9dcc)
@@ -29,8 +29,6 @@ module Droonga
     CATALOG_FILE_PATH = 'catalog.json'
 
     def initialize
-      catalog_path = ENV["DROONGA_CATALOG"] || CATALOG_FILE_PATH
-      catalog_path = File.expand_path(catalog_path)
       open(catalog_path) do |file|
         @catalog = JSON.parse(file.read)
       end
@@ -53,6 +51,12 @@ module Droonga
       @options = @catalog["options"] || {}
     end
 
+    def catalog_path
+      return @catalog_path unless @catalog_path.nil?
+      catalog_path = ENV["DROONGA_CATALOG"] || CATALOG_FILE_PATH
+      @catalog_path = File.expand_path(catalog_path)
+    end
+
     def option(name)
       @options[name]
     end
-------------- next part --------------
HTML����������������������������...
Download 



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