diff --git a/activesupport/lib/active_support/core_ext/kernel/singleton_class.rb b/activesupport/lib/active_support/core_ext/kernel/singleton_class.rb new file mode 100644 index 0000000000000000000000000000000000000000..33612155fb64938420d1c71f5c92b58aafa6f113 --- /dev/null +++ b/activesupport/lib/active_support/core_ext/kernel/singleton_class.rb @@ -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 diff --git a/activesupport/lib/active_support/core_ext/module/remove_method.rb b/activesupport/lib/active_support/core_ext/module/remove_method.rb new file mode 100644 index 0000000000000000000000000000000000000000..2714a46b28737137d4d64ada3db85268838d268b --- /dev/null +++ b/activesupport/lib/active_support/core_ext/module/remove_method.rb @@ -0,0 +1,6 @@ +class Module + def remove_possible_method(method) + remove_method(method) + rescue NameError + end +end \ No newline at end of file