X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=vendor%2Frails%2Factivesupport%2Flib%2Factive_support%2Fbasic_object.rb;fp=vendor%2Frails%2Factivesupport%2Flib%2Factive_support%2Fbasic_object.rb;h=1f77209e7f3099a254e6434b2a461505ff5c5531;hb=d115f2e23823271635bad69229a42cd8ac68debe;hp=0000000000000000000000000000000000000000;hpb=37cb670bf3ddde90b214e591f100ed4446469484;p=depot.git diff --git a/vendor/rails/activesupport/lib/active_support/basic_object.rb b/vendor/rails/activesupport/lib/active_support/basic_object.rb new file mode 100644 index 0000000..1f77209 --- /dev/null +++ b/vendor/rails/activesupport/lib/active_support/basic_object.rb @@ -0,0 +1,24 @@ +# 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