summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/final.rb39
-rw-r--r--lib/tempfile.rb1
2 files changed, 1 insertions, 39 deletions
diff --git a/lib/final.rb b/lib/final.rb
index cdffd941e7..9d81238823 100644
--- a/lib/final.rb
+++ b/lib/final.rb
@@ -1,41 +1,4 @@
-#
# $Id$
# Copyright (C) 1998 Yukihiro Matsumoto. All rights reserved.
-# The ObjectSpace extension:
-#
-# ObjectSpace.define_finalizer(obj, proc=lambda())
-#
-# Defines the finalizer for the specified object.
-#
-# ObjectSpace.undefine_finalizer(obj)
-#
-# Removes the finalizers for the object. If multiple finalizers are
-# defined for the object, all finalizers will be removed.
-#
-
-module ObjectSpace
- Finalizers = {}
- def define_finalizer(obj, proc=lambda())
- ObjectSpace.call_finalizer(obj)
- if assoc = Finalizers[obj.id]
- assoc.push(proc)
- else
- Finalizers[obj.id] = [proc]
- end
- end
- def undefine_finalizer(obj)
- Finalizers.delete(obj.id)
- end
- module_function :define_finalizer, :undefine_finalizer
-
- Generic_Finalizer = proc {|id|
- if Finalizers.key? id
- for proc in Finalizers[id]
- proc.call(id)
- end
- Finalizers.delete(id)
- end
- }
- add_finalizer Generic_Finalizer
-end
+# final.rb is integrated into ObjectSpace; no longer needed.
diff --git a/lib/tempfile.rb b/lib/tempfile.rb
index 0e4c99e5ff..10f05a3b2b 100644
--- a/lib/tempfile.rb
+++ b/lib/tempfile.rb
@@ -10,7 +10,6 @@
# o file mode of the temporary files are 0600.
require 'delegate'
-require 'final'
class Tempfile < SimpleDelegator
Max_try = 10