Kouhei Sutou
kous****@users*****
Fri Jun 9 11:27:54 JST 2006
Index: kazehakase/data/ext/ruby/kazehakase-init-pre.rb diff -u kazehakase/data/ext/ruby/kazehakase-init-pre.rb:1.4 kazehakase/data/ext/ruby/kazehakase-init-pre.rb:1.5 --- kazehakase/data/ext/ruby/kazehakase-init-pre.rb:1.4 Sun Feb 12 00:29:52 2006 +++ kazehakase/data/ext/ruby/kazehakase-init-pre.rb Fri Jun 9 11:27:54 2006 @@ -1,6 +1,14 @@ +require 'fileutils' + module Kz EXIT_PROCS = [] class << self + def barrier + yield + rescue Exception + print_error($!) + end + def print_warning(message) STDERR.puts("** KzRuby WARNING **: #{message}") end @@ -39,6 +47,14 @@ begin require 'gtk2' ENABLE = true + TMP_DIR = File.join(GLib.tmp_dir, PACKAGE) + barrier do + FileUtils.rm_rf(TMP_DIR) + FileUtils.mkdir_p(TMP_DIR) + add_exit_proc do + FileUtils.rm_rf(TMP_DIR) + end + end rescue Exception ENABLE = false print_warning(_("Ruby extension disabled: failed require 'gtk2'")) Index: kazehakase/data/ext/ruby/kazehakase-init.rb diff -u kazehakase/data/ext/ruby/kazehakase-init.rb:1.7 kazehakase/data/ext/ruby/kazehakase-init.rb:1.8 --- kazehakase/data/ext/ruby/kazehakase-init.rb:1.7 Thu Jun 8 22:39:18 2006 +++ kazehakase/data/ext/ruby/kazehakase-init.rb Fri Jun 9 11:27:54 2006 @@ -4,12 +4,6 @@ DEFAULT_LOAD_PATH = $LOAD_PATH.dup class << self - def barrier - yield - rescue Exception - print_error($!) - end - def reload(kz) barrier do if ENABLE