aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-12-25 11:08:15 -0800
committerJosé Valim <jose.valim@gmail.com>2011-12-25 11:08:15 -0800
commit4e1999d20e4135d586135bbd37d4e2a86ca8975b (patch)
tree59aceec0206318490ffa6b92248c9a69fcb37e4e
parentfc4f56ad05b7a6a9c05d661f8a645286a7d6b0e3 (diff)
parent3f967dc5f910c5ffeae2f397a6b0f499c1eb7540 (diff)
downloadrails-4e1999d20e4135d586135bbd37d4e2a86ca8975b.tar.gz
rails-4e1999d20e4135d586135bbd37d4e2a86ca8975b.tar.bz2
rails-4e1999d20e4135d586135bbd37d4e2a86ca8975b.zip
Merge pull request #4187 from castlerock/basic_object_in_19
::BasicObject always defined in ruby 19
-rw-r--r--activesupport/lib/active_support/basic_object.rb25
1 files changed, 9 insertions, 16 deletions
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