[Groonga-commit] ranguba/chupa-text at 1065d2e [master] Don't change current directory on require

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Jan 3 19:32:38 JST 2014


Kouhei Sutou	2014-01-03 19:32:38 +0900 (Fri, 03 Jan 2014)

  New Revision: 1065d2e981889ced5ddbea64f3a18b360a20422d
  https://github.com/ranguba/chupa-text/commit/1065d2e981889ced5ddbea64f3a18b360a20422d

  Message:
    Don't change current directory on require

  Modified files:
    lib/chupa-text/decomposers.rb

  Modified: lib/chupa-text/decomposers.rb (+5 -1)
===================================================================
--- lib/chupa-text/decomposers.rb    2014-01-03 19:12:08 +0900 (8cc1c2e)
+++ lib/chupa-text/decomposers.rb    2014-01-03 19:32:38 +0900 (16fb9ec)
@@ -20,14 +20,18 @@ module ChupaText
   module Decomposers
     class << self
       def load
+        paths = []
         $LOAD_PATH.each do |load_path|
           next unless File.directory?(load_path)
           Dir.chdir(load_path) do
             Dir.glob("chupa-text/decomposers/*.rb") do |decomposer_path|
-              require decomposer_path.gsub(/\.rb\z/, "")
+              paths << decomposer_path.gsub(/\.rb\z/, "")
             end
           end
         end
+        paths.each do |path|
+          require path
+        end
       end
 
       def create(registry, configuration)
-------------- next part --------------
HTML����������������������������...
Download 



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