encoding: utf-8
(Not documented)
# File rumix/function.rb, line 8 def self.base_dir if defined?(ExerbRuntime) then File.expand_path(File.dirname(ExerbRuntime.filepath)) else Dir.pwd end end
(Not documented)
# File rumix/function.rb, line 77 def self.delete_delay_until_reboot(path) movefile_delay_until_reboot = 4 begin api = Win32API.new('kernel32', 'MoveFileEx', %w(p i i), 'i') rescue return false end ret = api.call("#{path}\0", 0, movefile_delay_until_reboot) return(ret != 0) end
(Not documented)
# File rumix/function.rb, line 30 def self.delete_directory_recursively(dir_name, real_operating = false, entries_buffer = [], &block) # 配列が渡された場合 if dir_name.kind_of?(Array) then dir_name.each do |real_dir_name| delete_directory_recursively(real_dir_name, real_operating, entries_buffer, &block) end return entries_buffer end path = Pathname.new(dir_name) if path.directory? then path.children.each do |entry| entry = entry.to_s if File.directory?(entry) then delete_directory_recursively(entry, real_operating, entries_buffer, &block) block.call(:directory_ready, entry) if block Dir.rmdir(entry) if real_operating block.call(:directory, entry) if block entries_buffer << entry elsif File.file?(entry) then block.call(:file_ready, entry) if block if real_operating then begin File.unlink(entry) rescue Errno::EACCES # 実行中ファイルにアクセスした場合 if delete_delay_until_reboot(entry) then block.call(:delayed_deleting_success, entry) if block else block.call(:delayed_deleting_failure, entry) if block end end end block.call(:file, entry) if block entries_buffer << entry else raise "#{entry} is not file and not directory. (unknown type entry)" end end end return entries_buffer end
(Not documented)
# File rumix/wx.rb, line 7 def self.run_on_thread(&proc) stop_running_thread Thread.abort_on_exception = true thread = Thread.new{ begin proc.call rescue Exception open(File.join(Rumix.base_dir, 'operation_error.log'), 'w'){|f| f.puts $!.to_s f.puts $!.backtrace } Kernel.raise $! end } timer = Wx::Timer.every(1) do Thread.pass end @running_thread = thread @running_timer = timer return thread end
Disabled; run with $DEBUG to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.