update.
[chise/ruby.git] / chise / config.rb
index 1494d39..c52395e 100755 (executable)
@@ -1,30 +1,36 @@
 # Copyright (C) 2002-2004 Kouichirou Eto, All rights reserved.
 
 require "singleton"
+require "chise/version"
 
 module CHISE
+  # on Winodws
+  DB_DIR  = "c:/chise/chise-db" # /character/feature/=ucs
+  IDS_DIR = "c:/chise/ids" # /IDS-JIS-X0208-1990.txt
+
+  # on Unix
+  #DB_DIR  = "/usr/local/lib/xemacs-21.4.14/i686-pc-linux/chise-db"
+  #IDS_DIR = "/home/eto/work/chise/ids"
+
   def windows?()
     rp = RUBY_PLATFORM
-    rp =~ /cygwin/ || rp =~ /mswin32/ || rp =~ /mingw32/
+    rp.index("cygwin") || rp.index("mswin32") || rp.index("mingw32")
   end
   module_function :windows?
 
   class Config
     include Singleton
+
     def initialize
+      @version = VERSION
+      @release_date = RELEASE_DATE
+
       @base_dir = File.expand_path(File.dirname(__FILE__)+"/../..")
-#     @base_dir = "c:/chise"
-#     qp @base_dir
+      @csf_dir = @base_dir+"/csf"
 
-      if CHISE.windows?()
-       @db_dir  = @base_dir+"/char-db" # /sysmtem-char-id/ucs
-       @ids_dir = @base_dir+"/ids" # /IDS-JIS-X0208-1990.txt
-      else
-       @db_dir  = "/usr/local/lib/xemacs-21.4.12/i686-pc-linux/char-db"
-       @ids_dir = "/home/eto/chise/ids"
-      end
+      @db_dir  = DB_DIR
+      @ids_dir = IDS_DIR
 
-      @csf_dir = @base_dir+"/csf"
       instance_variables.each {|name|
        self.class.class_eval { attr_reader name.delete("@") }
       }