Project

General

Profile

This project is closed and read-only.

Actions

Bug #3070

closed

Delegator#method_missing doesn't pass along block args

Bug #3070: Delegator#method_missing doesn't pass along block args

Added by stouset (Stephen Touset) over 16 years ago. Updated over 15 years ago.

Status:
Closed
Assignee:
-
ruby -v:
1.8.7 (2008-08-11 patchlevel 72)
[ruby-core:29170]

Description

=begin
The particular instance of this bug I'm running up against is that Tempfile delegates to File. I've written a method on File which accepts a block, but any time it's called from a Tempfile, Ruby raises a LocalJumpError, because the block argument hasn't been passed.

Seems like a pretty easy fix.

def method_missing(m, *args, &block)
target = self.getobj
unless target.respond_to?(m)
super(m, *args, &block)
end
target.send(m, *args, &block)
end
=end

Updated by stouset (Stephen Touset) over 16 years ago Actions #1

=begin
It looks like this is actually also a bug in the DelegatorClass method that Tempfile actually uses behind the scenes. It should be patched there as well.
=end

Updated by marcandre (Marc-Andre Lafortune) over 16 years ago Actions #2

  • Category set to lib
  • Status changed from Open to Closed

=begin
Already fixed in 1.8.7+ with r23380 , r24136
=end

Actions

Also available in: PDF Atom