update.
[chise/ruby.git] / chise / management.rb
index 2e17209..781a3ec 100755 (executable)
@@ -6,28 +6,10 @@ require "chise/char"
 require "chise/qp"
 
 module CHISE
-  module TableAccessModule
-    def to_hash
-      h = {}
-      each {|k, v| h[k] = v }
-      h
-    end
-
-    def dump
-      txt = @name.path.escape.escape_win_filename.to_s+".txt"
-      t = @ds.location+@category+@keyvalue+txt
-      t.open("wb"){|out|
-       to_hash.sort.each {|k, v|
-         out.printf("%s\t%s\n", k, v)
-       }
-      }
-    end
-  end
-
   class DataBaseManagement
     def dump_all
       cd = ChiseDB.instance
-      cd.each_feature {|f|
+      cd.each_feature_name {|f|
        ft = cd.get_feature(f)
        ft.dump
        ft.close
@@ -86,8 +68,10 @@ iso-10646-comment
     end
 
     def move_obsolete_files
-      fpath = Config.instance.db_dir.path+"system-char-id"
-      fpath.chdir {
+      #fpath = Config.instance.db_dir.path+"system-char-id"
+      fpath = Config.instance.db_dir.path+"character/feature"
+      #fpath.chdir {
+      Dir.chdir(fpath.to_s) {
        opath = "obsolete".path
        opath.mkdir unless opath.directory?
 
@@ -96,7 +80,7 @@ iso-10646-comment
          next if /\A#/ =~ attr
          f = attr.path.escape.escape_win_filename
          FileUtils.mv(f.to_s, opath.to_s, @opt) if f.exist?
-         f = f.to_s+".txt"
+         f = (f.to_s+".txt").path
          FileUtils.mv(f.to_s, opath.to_s, @opt) if f.exist?
        }
       }