Skip to content
This repository
Browse code

Merge pull request #4187 from castlerock/basic_object_in_19

::BasicObject always defined in ruby 19
  • Loading branch information...
commit 4e1999d20e4135d586135bbd37d4e2a86ca8975b 2 parents fc4f56a + 3f967dc
José Valim authored
25  activesupport/lib/active_support/basic_object.rb
... ...
@@ -1,21 +1,14 @@
1 1
 module ActiveSupport
2  
-  if defined? ::BasicObject
3  
-    # A class with no predefined methods that behaves similarly to Builder's
4  
-    # BlankSlate. Used for proxy classes.
5  
-    class BasicObject < ::BasicObject
6  
-      undef_method :==
7  
-      undef_method :equal?
  2
+  # A class with no predefined methods that behaves similarly to Builder's
  3
+  # BlankSlate. Used for proxy classes.
  4
+  class BasicObject < ::BasicObject
  5
+    undef_method :==
  6
+    undef_method :equal?
8 7
 
9  
-      # Let ActiveSupport::BasicObject at least raise exceptions.
10  
-      def raise(*args)
11  
-        ::Object.send(:raise, *args)
12  
-      end
13  
-    end
14  
-  else
15  
-    class BasicObject #:nodoc:
16  
-      instance_methods.each do |m|
17  
-        undef_method(m) if m.to_s !~ /(?:^__|^nil\?$|^send$|^object_id$)/
18  
-      end
  8
+    # Let ActiveSupport::BasicObject at least raise exceptions.
  9
+    def raise(*args)
  10
+      ::Object.send(:raise, *args)
19 11
     end
20 12
   end
  13
+
21 14
 end

0 notes on commit 4e1999d

Please sign in to comment.
Something went wrong with that request. Please try again.