mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
lib/delegate.rb: Backport #1781 [ruby-core:24356]; allow a block to be properly passed through.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@28239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0881fce516
commit
09a7d0173b
3 changed files with 15 additions and 11 deletions
|
@ -1,6 +1,10 @@
|
|||
Thu Jun 10 01:40:00 Kirk Haines <khaines@ruby-lang.org>
|
||||
|
||||
* lib/delegate.rb: Backport #1781 [ruby-core:24356]; allow a block to be properly passed through.
|
||||
|
||||
Wed Jun 9 04:35:00 Kirk Haines <khaines@ruby-lang.org>
|
||||
|
||||
* gc.c: Backport #1785 [ruby-core:24395]; check to make sure finalizer_table isn't null before trying to run finalizers.
|
||||
* gc.c: Backport #1785 [ruby-core:24395]; check to make sure finalizer_table isn't null before trying to run finalizers. r28235
|
||||
|
||||
Wed Jun 9 02:10:00 Kirk Haines <khaines@ruby-lang.org>
|
||||
|
||||
|
|
|
@ -152,12 +152,12 @@ class Delegator
|
|||
alias initialize_methods initialize
|
||||
|
||||
# Handles the magic of delegation through \_\_getobj\_\_.
|
||||
def method_missing(m, *args)
|
||||
def method_missing(m, *args, &block)
|
||||
target = self.__getobj__
|
||||
unless target.respond_to?(m)
|
||||
super(m, *args)
|
||||
super(m, *args, &block)
|
||||
end
|
||||
target.__send__(m, *args)
|
||||
target.__send__(m, *args, &block)
|
||||
end
|
||||
|
||||
#
|
||||
|
@ -265,11 +265,11 @@ def DelegateClass(superclass)
|
|||
def initialize(obj) # :nodoc:
|
||||
@_dc_obj = obj
|
||||
end
|
||||
def method_missing(m, *args) # :nodoc:
|
||||
def method_missing(m, *args, &block) # :nodoc:
|
||||
unless @_dc_obj.respond_to?(m)
|
||||
super(m, *args)
|
||||
super(m, *args, &block)
|
||||
end
|
||||
@_dc_obj.__send__(m, *args)
|
||||
@_dc_obj.__send__(m, *args, &block)
|
||||
end
|
||||
def respond_to?(m, include_private = false) # :nodoc:
|
||||
return true if super
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
#define RUBY_VERSION "1.8.6"
|
||||
#define RUBY_RELEASE_DATE "2010-06-09"
|
||||
#define RUBY_RELEASE_DATE "2010-06-10"
|
||||
#define RUBY_VERSION_CODE 186
|
||||
#define RUBY_RELEASE_CODE 20100609
|
||||
#define RUBY_PATCHLEVEL 411
|
||||
#define RUBY_RELEASE_CODE 20100610
|
||||
#define RUBY_PATCHLEVEL 412
|
||||
|
||||
#define RUBY_VERSION_MAJOR 1
|
||||
#define RUBY_VERSION_MINOR 8
|
||||
#define RUBY_VERSION_TEENY 6
|
||||
#define RUBY_RELEASE_YEAR 2010
|
||||
#define RUBY_RELEASE_MONTH 6
|
||||
#define RUBY_RELEASE_DAY 9
|
||||
#define RUBY_RELEASE_DAY 10
|
||||
|
||||
#ifdef RUBY_EXTERN
|
||||
RUBY_EXTERN const char ruby_version[];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue