update.
[chise/ruby.git] / chise / config.rb
1 # Copyright (C) 2002-2004 Kouichirou Eto, All rights reserved.
2
3 require "singleton"
4 require "chise/version"
5
6 module CHISE
7   # on Winodws
8   DB_DIR  = "c:/chise/chise-db" # /character/feature/=ucs
9   IDS_DIR = "c:/chise/ids" # /IDS-JIS-X0208-1990.txt
10
11   # on Unix
12   #DB_DIR  = "/usr/local/lib/xemacs-21.4.14/i686-pc-linux/chise-db"
13   #IDS_DIR = "/home/eto/work/chise/ids"
14
15   def windows?()
16     rp = RUBY_PLATFORM
17     rp.index("cygwin") || rp.index("mswin32") || rp.index("mingw32")
18   end
19   module_function :windows?
20
21   class Config
22     include Singleton
23
24     def initialize
25       @version = VERSION
26       @release_date = RELEASE_DATE
27
28       @base_dir = File.expand_path(File.dirname(__FILE__)+"/../..")
29       @csf_dir = @base_dir+"/csf"
30
31       @db_dir  = DB_DIR
32       @ids_dir = IDS_DIR
33
34       instance_variables.each {|name|
35         self.class.class_eval { attr_reader name.delete("@") }
36       }
37     end
38   end
39 end