[Groonga-commit] droonga/droonga-engine at ae18c91 [master] Add Droonga::Path

Back to archive index

Kouhei Sutou null+****@clear*****
Mon May 26 16:25:51 JST 2014


Kouhei Sutou	2014-05-26 16:25:51 +0900 (Mon, 26 May 2014)

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

  Message:
    Add Droonga::Path
    
    Move `Droonga.base_path` and `Droonga.state_path` to `Droonga::Path`.

  Modified files:
    lib/droonga/catalog_observer.rb
    lib/droonga/command/droonga_engine.rb
    lib/droonga/command/serf_event_handler.rb
    lib/droonga/live_nodes_list_observer.rb
    lib/droonga/serf.rb
    lib/droonga/serf_downloader.rb
  Renamed files:
    lib/droonga/path.rb
      (from lib/droonga/base_path.rb)

  Modified: lib/droonga/catalog_observer.rb (+2 -2)
===================================================================
--- lib/droonga/catalog_observer.rb    2014-05-26 16:20:43 +0900 (66d2b3d)
+++ lib/droonga/catalog_observer.rb    2014-05-26 16:25:51 +0900 (152729c)
@@ -15,7 +15,7 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-require "droonga/base_path"
+require "droonga/path"
 require "droonga/loggable"
 require "droonga/catalog_loader"
 
@@ -61,7 +61,7 @@ module Droonga
 
     def catalog_path
       path = ENV["DROONGA_CATALOG"] || DEFAULT_CATALOG_PATH
-      File.expand_path(path, Droonga.base_path)
+      File.expand_path(path, Droonga::Path.base)
     end
 
     def catalog_updated?

  Modified: lib/droonga/command/droonga_engine.rb (+2 -2)
===================================================================
--- lib/droonga/command/droonga_engine.rb    2014-05-26 16:20:43 +0900 (81ee8fc)
+++ lib/droonga/command/droonga_engine.rb    2014-05-26 16:25:51 +0900 (cd1f8e3)
@@ -19,7 +19,7 @@ require "ipaddr"
 require "fileutils"
 require "pathname"
 
-require "droonga/base_path"
+require "droonga/path"
 require "droonga/engine"
 require "droonga/serf"
 require "droonga/event_loop"
@@ -159,7 +159,7 @@ module Droonga
         def run(command_line_arguments)
           parse_command_line_arguments!(command_line_arguments)
 
-          ENV[Droonga::BASE_DIR_ENV_NAME] ||= Dir.pwd
+          ENV[Droonga::Path::BASE_DIR_ENV_NAME] ||= Dir.pwd
 
           if****@confi*****?
             Process.daemon

  Modified: lib/droonga/command/serf_event_handler.rb (+2 -2)
===================================================================
--- lib/droonga/command/serf_event_handler.rb    2014-05-26 16:20:43 +0900 (6e09e85)
+++ lib/droonga/command/serf_event_handler.rb    2014-05-26 16:25:51 +0900 (5670e7d)
@@ -18,7 +18,7 @@ require "pathname"
 require "json"
 require "fileutils"
 
-require "droonga/base_path"
+require "droonga/path"
 require "droonga/serf"
 require "droonga/live_nodes_list_observer"
 
@@ -69,7 +69,7 @@ module Droonga
       end
 
       def list_file
-        @list_file ||= Droonga.state_path + LiveNodesListObserver::LIST_FILE_NAME
+        @list_file ||= Droonga::Path.state + LiveNodesListObserver::LIST_FILE_NAME
       end
 
       def output_live_nodes

  Modified: lib/droonga/live_nodes_list_observer.rb (+2 -2)
===================================================================
--- lib/droonga/live_nodes_list_observer.rb    2014-05-26 16:20:43 +0900 (7a6743e)
+++ lib/droonga/live_nodes_list_observer.rb    2014-05-26 16:25:51 +0900 (67c988b)
@@ -16,7 +16,7 @@
 require "fileutils"
 require "listen"
 
-require "droonga/base_path"
+require "droonga/path"
 require "droonga/loggable"
 require "droonga/live_nodes_list_loader"
 
@@ -65,7 +65,7 @@ module Droonga
     private
     def prepare_file_path
       path = ENV["DROONGA_LIVE_NODES_LIST"] || LIST_FILE_NAME
-      File.expand_path(path, Droonga.state_path)
+      File.expand_path(path, Droonga::Path.state)
     end
 
     def log_tag

  Renamed: lib/droonga/path.rb (+9 -7) 77%
===================================================================
--- lib/droonga/base_path.rb    2014-05-26 16:20:43 +0900 (e0907d4)
+++ lib/droonga/path.rb    2014-05-26 16:25:51 +0900 (03b245e)
@@ -16,15 +16,17 @@
 require "pathname"
 
 module Droonga
-  BASE_DIR_ENV_NAME = "DROONGA_BASE_DIR"
+  module Path
+    BASE_DIR_ENV_NAME = "DROONGA_BASE_DIR"
 
-  class << self
-    def base_path
-      @base_path ||= Pathname.new(ENV[BASE_DIR_ENV_NAME] || Dir.pwd)
-    end
+    class << self
+      def base
+        @base ||= Pathname.new(ENV[BASE_DIR_ENV_NAME] || Dir.pwd)
+      end
 
-    def state_path
-      base_path + "state"
+      def state
+        base + "state"
+      end
     end
   end
 end

  Modified: lib/droonga/serf.rb (+2 -2)
===================================================================
--- lib/droonga/serf.rb    2014-05-26 16:20:43 +0900 (465b580)
+++ lib/droonga/serf.rb    2014-05-26 16:25:51 +0900 (a58f489)
@@ -13,7 +13,7 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-require "droonga/base_path"
+require "droonga/path"
 require "droonga/loggable"
 require "droonga/catalog_observer"
 require "droonga/serf_downloader"
@@ -22,7 +22,7 @@ module Droonga
   class Serf
     class << self
       def path
-        @path ||= Droonga.base_path + "serf"
+        @path ||= Droonga::Path.base + "serf"
       end
     end
 

  Modified: lib/droonga/serf_downloader.rb (+0 -1)
===================================================================
--- lib/droonga/serf_downloader.rb    2014-05-26 16:20:43 +0900 (814dd4d)
+++ lib/droonga/serf_downloader.rb    2014-05-26 16:25:51 +0900 (1b8ce59)
@@ -21,7 +21,6 @@ require "faraday"
 require "faraday_middleware"
 require "archive/zip"
 
-require "droonga/base_path"
 require "droonga/loggable"
 
 module Droonga
-------------- next part --------------
HTML����������������������������...
下載 



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