n.c.
[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   def windows?()
8     rp = RUBY_PLATFORM
9     rp.index("cygwin") || rp.index("mswin32") || rp.index("mingw32")
10   end
11   module_function :windows?
12
13   class Config
14     include Singleton
15
16     def initialize
17       @version = VERSION
18       @release_date = RELEASE_DATE
19
20       @base_dir = File.expand_path(File.dirname(__FILE__)+"/../..")
21       @csf_dir = @base_dir+"/csf"
22
23       if CHISE.windows?()
24         @db_dir  = @base_dir+"/chise-db" # /character/feature/=ucs
25         @ids_dir = @base_dir+"/ids" # /IDS-JIS-X0208-1990.txt
26       else
27         @db_dir  = "/usr/local/lib/xemacs-21.4.14/i686-pc-linux/chise-db"
28         @ids_dir = "/home/eto/work/chise/ids"
29       end
30
31       instance_variables.each {|name|
32         self.class.class_eval { attr_reader name.delete("@") }
33       }
34     end
35   end
36 end