instiki/vendor/rails/activesupport/lib/active_support/basic_object.rb
Jacques Distler 7600aef48b Upgrade to Rails 2.2.0
As a side benefit, fix an (non-user-visible) bug in display_s5().
Also fixed a bug where removing orphaned pages did not expire cached summary pages.
2008-10-27 01:47:01 -05:00

25 lines
794 B
Ruby

# A base class with no predefined methods that tries to behave like Builder's
# BlankSlate in Ruby 1.9. In Ruby pre-1.9, this is actually the
# Builder::BlankSlate class.
#
# Ruby 1.9 introduces BasicObject which differs slightly from Builder's
# BlankSlate that has been used so far. ActiveSupport::BasicObject provides a
# barebones base class that emulates Builder::BlankSlate while still relying on
# Ruby 1.9's BasicObject in Ruby 1.9.
module ActiveSupport
if defined? ::BasicObject
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
require 'blankslate'
BasicObject = BlankSlate
end
end