[Groonga-commit] droonga/droonga-engine at beb6095 [master] Work without --base-dir

Back to archive index

Kouhei Sutou null+****@clear*****
Thu May 29 17:32:14 JST 2014


Kouhei Sutou	2014-05-29 17:32:14 +0900 (Thu, 29 May 2014)

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

  Message:
    Work without --base-dir

  Modified files:
    lib/droonga/command/droonga_engine.rb
    lib/droonga/path.rb

  Modified: lib/droonga/command/droonga_engine.rb (+3 -3)
===================================================================
--- lib/droonga/command/droonga_engine.rb    2014-05-29 16:25:05 +0900 (205b29b)
+++ lib/droonga/command/droonga_engine.rb    2014-05-29 17:32:14 +0900 (6ead147)
@@ -42,7 +42,7 @@ module Droonga
       def run(command_line_arguments)
         parse_command_line_arguments!(command_line_arguments)
 
-        ensure_path
+        setup_path
 
         if****@confi*****?
           Process.daemon
@@ -62,8 +62,8 @@ module Droonga
         parser.parse!(command_line_arguments)
       end
 
-      def ensure_path
-        Path.base
+      def setup_path
+        Path.setup
         unless $0 == File.basename($0)
           droonga_engine_bin_path = File.expand_path(File.dirname($0))
           new_paths = [

  Modified: lib/droonga/path.rb (+5 -0)
===================================================================
--- lib/droonga/path.rb    2014-05-29 16:25:05 +0900 (cd4c576)
+++ lib/droonga/path.rb    2014-05-29 17:32:14 +0900 (46cb4c4)
@@ -20,6 +20,11 @@ module Droonga
     BASE_DIR_ENV_NAME = "DROONGA_BASE_DIR"
 
     class << self
+      def setup
+        base_dir = ENV[BASE_DIR_ENV_NAME] || Dir.pwd
+        ENV[BASE_DIR_ENV_NAME] = File.expand_path(base_dir)
+      end
+
       def base
         @base ||= Pathname.new(ENV[BASE_DIR_ENV_NAME] || Dir.pwd).expand_path
       end
-------------- next part --------------
HTML����������������������������...
下载 



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