Froze rails gems
[depot.git] / vendor / rails / activesupport / lib / active_support / basic_object.rb
1 # A base class with no predefined methods that tries to behave like Builder's
2 # BlankSlate in Ruby 1.9. In Ruby pre-1.9, this is actually the
3 # Builder::BlankSlate class.
4 #
5 # Ruby 1.9 introduces BasicObject which differs slightly from Builder's
6 # BlankSlate that has been used so far. ActiveSupport::BasicObject provides a
7 # barebones base class that emulates Builder::BlankSlate while still relying on
8 # Ruby 1.9's BasicObject in Ruby 1.9.
9 module ActiveSupport
10 if defined? ::BasicObject
11 class BasicObject < ::BasicObject
12 undef_method :==
13 undef_method :equal?
14
15 # Let ActiveSupport::BasicObject at least raise exceptions.
16 def raise(*args)
17 ::Object.send(:raise, *args)
18 end
19 end
20 else
21 require 'blankslate'
22 BasicObject = BlankSlate
23 end
24 end