summaryrefslogtreecommitdiff
path: root/lib/delegate.rb
AgeCommit message (Collapse)Author
2014-07-26* lib/delegate.rb: split executable code into sample directory.hsbt
* sample/delegate.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-30* lib/delegate.rb: [DOC] Document raise in Delegator classzzak
Patch by @lucasmazza. [Fixes GH-621] https://github.com/ruby/ruby/pull/621 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-08* lib/delegate.rb: Fix example of using delegator.ayumin
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-17delegate.rb: keep special methodsnobu
* 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
2013-12-04delegate.rb: ignore unset targetnobu
* 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
2013-11-21delegate.rb: check if target is setnobu
* lib/delegate.rb (SimpleDelegator#__getobj__): target object must be set. * lib/delegate.rb (DelegateClass#__getobj__): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-21delegate.rb: try private methods after the targetnobu
* 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
2013-11-19delegate.rb: refix r43682nobu
* 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
2013-11-15delegate.rb: get rid of global function interferencenobu
* 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
2013-07-10* lib/delegate.rb: Add example for __setobj__ and __getobj__zzak
[Bug #8615] Patch by Caleb Thompson git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-08* lib/delegate.rb: Added documentation for Delegator#!. Patch bydrbrain
Zachary Scott. [ruby-trunk - Feature #6534] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-04* lib/delegate.rb (Delegator#methods): Kernel#methods receivesnaruse
zero or one argument. [ruby-core:37118] [Bug #4882] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-27 * lib/delegate.rb: Move file-level documentation to the appropriatedrbrain
classes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-19* lib: revert r31635-r31638 and untabify with expand(1).nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-18 * lib: Convert tabs to spaces for ruby files perdrbrain
http://redmine.ruby-lang.org/projects/ruby/wiki/DeveloperHowto#coding-style Patch by Steve Klabnik [Ruby 1.9 - Bug #4730] Patch by Jason Dew [Ruby 1.9 - Feature #4718] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-22* lib/delegate.rb: Forward #trust, #untrust, #taint and #untaintmarcandre
to both the delegator and __getobj__ [ruby-core:26138] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-12* lib/delegate.rb: Delegate !=, eql? and hash [ruby-core:26139]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-30* lib/delegate: Delegator: combine (public|protected) methods withmarcandre
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
2010-04-10Fix :nodoc: definition. [ruby-dev:40949]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-08* object.c (rb_obj_clone): call initialize_clone hook method tomatz
call initialize_copy. * object.c (rb_obj_dup): call initialize_dup hook. * lib/delegate.rb (Delegator#initialize_clone): use new hook to implement deep copy. [ruby-dev:40242] * lib/delegate.rb (Delegator#initialize_dup): ditto. * test/test_delegate.rb (TestDelegateClass#test_copy_frozen): add a test to ensure #clone copies frozen status. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-06* lib/delegate.rb (Delegator#method_missing),nobu
(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
2010-02-05* lib/delegate.rb (Delegator): include copy of Kernel.nobu
[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
2010-02-03* lib/delegate.rb (Delegator): now inherits BasicObject.nobu
[ruby-dev:39154], [Bug #2679], [ruby-dev:40242] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-02* lib/delegate.rb (Delegator#marshal_dump): excludenobu
delegator-specific instance variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-28* lib/delegate.rb (Delegator#initialize_copy): use initialize_copymatz
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
2009-12-29* lib/delegate.rb (marshal_dump/load): Provide forward compatibility ↵marcandre
[ruby-core:24211] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-24* lib/delegate.rb (marshal_dump/load): dump & load instance variables by ↵marcandre
default [ruby-core:24211] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-24* object.c (rb_obj_cmp): defines Object#<=>. [ruby-core:24063]matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-17* vm_method.c (basic_obj_respond_to): call #respond_to_missing?matz
always with two arguments. [ruby-core:26090] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-17* lib/delegate.rb (Delegator#respond_to_missing): warn only whenmatz
specified method is a private. [ruby-dev:39498] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-16* lib/delegate: rdoc typomarcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-16* lib/delegate.rb (Delegator#method_missing): remove backtracematz
lines _until_ `method_missing'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-16* lib/delegate.rb (Delegator#freeze): #freeze should freeze selfmatz
and the target at once. [ruby-core:26118] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-16* lib/delegate.rb (Delegator#respond_to_missing): warn if optionalmatz
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
2009-10-06* lib/delegate.rb (Delegator::public_api): take snapshot ofmatz
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
2009-08-13* lib/delegate.rb (Delegator#method_missing): __FILE__ may containmatz
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
2009-03-06* {ext,lib,test}/**/*.rb: removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-10* lib/delegate.rb (Delegator.delegating_block): should not refermatz
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
2008-10-15* lib/delegate.rb (DelegateClass): restored 1.8 behavior formatz
DelegateClass as well. [ruby-dev:36739] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-14* lib/delegate.rb (Delegator): simplified and restored 1.8matz
behavior. [ruby-dev:35986] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-04* lib/rdoc.rb: massive spelling correction patch from Evan Farrarmatz
<evanfarrar at gmail.com> in [ruby-doc:1382] applied. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-02* lib/delegate.rb (Delegator::MethodDelegation#respond_to):knu
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
2008-02-04* lib/delegate.rb (DelegateClass): use define_method instead ofnobu
module_eval to improve performance. [ruby-dev:33586] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-04 * lib/delegate.rb (Delegator.preserved, DelegateClass.methods): extendusa
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
2008-01-04* eval.c (Init_eval): move instance_eval and instance_exec tomatz
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
2007-12-10* eval.c (rb_f_public_send): rename invoke_method to public_send.matz
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
2007-11-04* eval.c (rb_f_send): allow send/__send__ to call methods of allmatz
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
2007-08-26* io.c (rb_io_each_byte): caused infinite loop. [ruby-dev:31652]matz
* 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
2007-08-24* eval.c (rb_f_send_bang): abandon the name funcall for privatematz
aware method call. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-14* lib/delegate.rb: catch up with class local variable (@_v) spec.ko1
* lib/singleton.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e