backporting a couple missing files. sorry folks!

This commit is contained in:
Aaron Patterson
2010-07-16 08:41:53 -07:00
parent f57ca87729
commit 4ae4828953
2 changed files with 19 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
module Kernel
# Returns the object's singleton class.
def singleton_class
class << self
self
end
end unless respond_to?(:singleton_class) # exists in 1.9.2
# class_eval on an object acts like singleton_class.class_eval.
def class_eval(*args, &block)
singleton_class.class_eval(*args, &block)
end
end

View File

@@ -0,0 +1,6 @@
class Module
def remove_possible_method(method)
remove_method(method)
rescue NameError
end
end