1 # Copyright (C) 2002-2004 Kouichirou Eto, All rights reserved.
9 class DataBaseManagement
13 cd.each_feature_name {|f|
14 ft = cd.get_feature(f)
27 class DataBaseFileManagement
29 # from specs/char-atr.ja.txt
56 ancient-char-of-shinjigen-1
58 original-char-of-shinjigen-1
60 vulgar-char-of-shinjigen-1
62 variant-of-shinjigen-1
68 # @opt = {:noop=>true, :verbose=>true}
69 @opt = {:verbose=>true}
72 def move_obsolete_files
73 #fpath = Config.instance.db_dir.path+"system-char-id"
74 fpath = Config.instance.db_dir.path+"character/feature"
76 Dir.chdir(fpath.to_s) {
77 opath = "obsolete".path
78 opath.mkdir unless opath.directory?
80 OBSOLETE_FEATURES.each {|attr|
83 f = attr.path.escape.escape_win_filename
84 FileUtils.mv(f.to_s, opath.to_s, @opt) if f.exist?
85 f = (f.to_s+".txt").path
86 FileUtils.mv(f.to_s, opath.to_s, @opt) if f.exist?
92 path = Config.instance.db_dir.path
94 nfpath = path+"character/feature"
95 FileUtils.mkdir_p(nfpath.to_s, @opt) unless nfpath.directory?
97 fpath = path+"system-char-id"
100 FileUtils.mv((fpath+f).to_s, nfpath.to_s, @opt)
103 ncpath = path+"character/by_feature"
104 FileUtils.mkdir_p(ncpath.to_s, @opt) unless ncpath.directory?
108 next if f.to_s == "character"
110 next unless d.directory?
111 ff = d + "system-char-id"
112 FileUtils.mv(ff.to_s, (ncpath+f).to_s, @opt) if ff.exist?