mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Introduce ActiveSupport::BasicObject which bridges Builder::BlankSlate and Ruby 1.9 BasicObject. Closes #10634 [Frederick Cheung]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8500 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
7555073803
commit
7bd33735d4
2 changed files with 14 additions and 9 deletions
|
@ -1065,11 +1065,7 @@ module ActionView
|
|||
end
|
||||
|
||||
# Converts chained method calls on DOM proxy elements into JavaScript chains
|
||||
class JavaScriptProxy < BasicObject #:nodoc:
|
||||
if ::RUBY_VERSION >= '1.9'
|
||||
undef_method :==
|
||||
undef_method :equal?
|
||||
end
|
||||
class JavaScriptProxy < ActiveSupport::BasicObject #:nodoc:
|
||||
|
||||
def initialize(generator, root = nil)
|
||||
@generator = generator
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
# Ruby 1.9 introduces BasicObject. Use Builder's BlankSlate until then.
|
||||
unless defined? BasicObject
|
||||
require 'blankslate'
|
||||
BasicObject = BlankSlate
|
||||
# Ruby 1.9 introduces BasicObject which differs slighly from Builder's BlankSlate
|
||||
# that had been used so far ActiveSupport::BasicObject provides a barebones object with
|
||||
# the same method on both versions.
|
||||
module ActiveSupport
|
||||
if RUBY_VERSION >= '1.9'
|
||||
class BasicObject < ::BasicObject
|
||||
undef_method :==
|
||||
undef_method :equal?
|
||||
end
|
||||
else
|
||||
require 'blankslate'
|
||||
BasicObject = BlankSlate
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue