1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/delegate.rb (Delegator.preserved, DelegateClass.methods): extend

shouldn't be delegated. [ruby-dev:32987], etc.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2008-02-04 05:01:00 +00:00
parent 50f6e01b44
commit 00f34f9274
2 changed files with 10 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Mon Feb 4 13:58:42 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* lib/delegate.rb (Delegator.preserved, DelegateClass.methods): extend
shouldn't be delegated. [ruby-dev:32987], etc.
Mon Feb 4 08:59:31 2008 Yukihiro Matsumoto <matz@ruby-lang.org> Mon Feb 4 08:59:31 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/cgi.rb (CGI::QueryExtension::[]): no more transition * lib/cgi.rb (CGI::QueryExtension::[]): no more transition

View file

@ -115,9 +115,10 @@
# implementation, see SimpleDelegator. # implementation, see SimpleDelegator.
# #
class Delegator class Delegator
preserved = [:__id__, :object_id, :__send__, :public_send, :respond_to?, :send, preserved = [
:instance_eval, :instance_exec, :__id__, :object_id, :__send__, :public_send, :respond_to?, :send,
] :instance_eval, :instance_exec, :extend,
]
instance_methods.each do |m| instance_methods.each do |m|
next if preserved.include?(m) next if preserved.include?(m)
undef_method m undef_method m
@ -267,6 +268,7 @@ def DelegateClass(superclass)
:__id__, :object_id, :__send__, :public_send, :respond_to?, :send, :__id__, :object_id, :__send__, :public_send, :respond_to?, :send,
:==, :equal?, :initialize, :method_missing, :__getobj__, :__setobj__, :==, :equal?, :initialize, :method_missing, :__getobj__, :__setobj__,
:clone, :dup, :marshal_dump, :marshal_load, :instance_eval, :instance_exec, :clone, :dup, :marshal_dump, :marshal_load, :instance_eval, :instance_exec,
:extend,
] ]
klass.module_eval { klass.module_eval {
include Delegator::MethodDelegation include Delegator::MethodDelegation