* lib/delegate.rb (Delegator): keep source information methods
which start and end with '__'. [ruby-core:58572] [Bug #9155]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/delegate.rb (Delegator#method_missing): ignore the target if not
set, and delegate to global methods. [ruby-core:58572] [Bug #9155]
* lib/delegate.rb (Delegator#respond_to_missing): ditto.
* lib/delegate.rb (SimpleDelegator#__getobj__): yield and return if
not delegated but a block is given, like as Hash#fetch.
* lib/delegate.rb (DelegateClass#__getobj__): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/delegate.rb (Delegator#method_missing): try private methods defined in
Kernel after the target. [Fixes GH-449]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/delegate.rb (Delegator#send): separate from method_missing so
that super calls proper method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/delegate.rb (Delegator#send): override to get rid of global function interference.
[Fixes GH-449]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
those of the delegated object. [ruby-core:27224]
DelegateClass: combine (public|protected) instance methods
with those of the delegated superclass.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(Delegator.delegating_block): don't hide backtrace from
__getobj__ and reduced exception messages when $DEBUG.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[ruby-dev:40314]
* lib/delegate.rb (Delegator#{dup,clone}): class of copy should be
Delegator. [ruby-dev:40313]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
instead of overriding clone/dup. [ruby-dev:40221]
it now always clones the target, it might cause incompatibility.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
include_private argument is not false. Delegator does (and
should) not forward private methods. [ruby-core:26080]
* lib/delegate.rb (Delegator#respond_to_missing): instead of
redefining #respond_to?, use #respond_to_missing?.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
public method at the beginning time.
* lib/delegate.rb (SimpleDelegator#initialize): use
Delegator.public_api since public_method might be added after
initialization. [ruby-dev:39383]
* lib/delegate.rb (DelegateClass): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
multi-byte characters. a patch from Kenta Murata in [ruby-dev:39066].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
DelegateClass specific @delegate_dc_obj. a patch from Erik
Hollensbe in [ruby-core:19671].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
respond_to? should now take optional second argument; submitted
by Jeremy Kemper <jeremy at bitsweat.net> in [ruby-core:17045].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
BasicObject. [ruby-core:14747]
* lib/delegate.rb: should preserve new methods in BasicObject.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
it now invokes public method only no matter how it's called.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
visibility again. we no longer provide __send, __send!.
* eval.c (rb_invoke_method): new method to honor private
visibility. if it's invoked in a function call style, it calls
private methods as well (previous 1.9 send behavior).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (rb_io_getc): should return nil at EOF, not EOFError.
* lib/delegate.rb (SimpleDelegator::__setobj__): use raise
argument to specify backtrace.
* test/ruby/test_fnmatch.rb (TestFnmatch::bracket_test):
String#include? no longer works for Fixnum. use #chr.
[ruby-dev:31652]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e