From 3f967dc5f910c5ffeae2f397a6b0f499c1eb7540 Mon Sep 17 00:00:00 2001 From: Vishnu Atrai Date: Mon, 26 Dec 2011 00:34:48 +0530 Subject: ::BasicObject always defined in ruby 19 --- activesupport/lib/active_support/basic_object.rb | 25 +++++++++--------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/basic_object.rb b/activesupport/lib/active_support/basic_object.rb index 3b5277c205..c3c7ab0112 100644 --- a/activesupport/lib/active_support/basic_object.rb +++ b/activesupport/lib/active_support/basic_object.rb @@ -1,21 +1,14 @@ module ActiveSupport - if defined? ::BasicObject - # A class with no predefined methods that behaves similarly to Builder's - # BlankSlate. Used for proxy classes. - class BasicObject < ::BasicObject - undef_method :== - undef_method :equal? + # A class with no predefined methods that behaves similarly to Builder's + # BlankSlate. Used for proxy classes. + class BasicObject < ::BasicObject + undef_method :== + undef_method :equal? - # Let ActiveSupport::BasicObject at least raise exceptions. - def raise(*args) - ::Object.send(:raise, *args) - end - end - else - class BasicObject #:nodoc: - instance_methods.each do |m| - undef_method(m) if m.to_s !~ /(?:^__|^nil\?$|^send$|^object_id$)/ - end + # Let ActiveSupport::BasicObject at least raise exceptions. + def raise(*args) + ::Object.send(:raise, *args) end end + end -- cgit v1.2.3