aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorYehuda Katz <wycats@mobile-166-129-139-135.mycingular.net>2009-11-07 11:23:34 -0800
committerYehuda Katz <wycats@mobile-166-129-139-135.mycingular.net>2009-11-07 11:23:34 -0800
commit103b29831e6d6a6c4363fd0e59ffcc6c343a14aa (patch)
treecfe1429453019bfbf4d107c1fef98ac393f30ad4 /activesupport
parente1b5e3cc709df12d2d8495737e524f60015e6f5c (diff)
downloadrails-103b29831e6d6a6c4363fd0e59ffcc6c343a14aa.tar.gz
rails-103b29831e6d6a6c4363fd0e59ffcc6c343a14aa.tar.bz2
rails-103b29831e6d6a6c4363fd0e59ffcc6c343a14aa.zip
Since we require 1.8.7 we don't need to shim instance_exec anymore
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/object/extending.rb27
1 files changed, 0 insertions, 27 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/extending.rb b/activesupport/lib/active_support/core_ext/object/extending.rb
index bbf6f8563b..0cc74c8298 100644
--- a/activesupport/lib/active_support/core_ext/object/extending.rb
+++ b/activesupport/lib/active_support/core_ext/object/extending.rb
@@ -50,31 +50,4 @@ class Object
def extend_with_included_modules_from(object) #:nodoc:
object.extended_by.each { |mod| extend mod }
end
-
- unless defined? instance_exec # 1.9
- module InstanceExecMethods #:nodoc:
- end
- include InstanceExecMethods
-
- # Evaluate the block with the given arguments within the context of
- # this object, so self is set to the method receiver.
- #
- # From Mauricio's http://eigenclass.org/hiki/bounded+space+instance_exec
- def instance_exec(*args, &block)
- begin
- old_critical, Thread.critical = Thread.critical, true
- n = 0
- n += 1 while respond_to?(method_name = "__instance_exec#{n}")
- InstanceExecMethods.module_eval { define_method(method_name, &block) }
- ensure
- Thread.critical = old_critical
- end
-
- begin
- send(method_name, *args)
- ensure
- InstanceExecMethods.module_eval { remove_method(method_name) } rescue nil
- end
- end
- end
end