Project

General

Profile

Actions

Backport #8436

closed

__dir__ not working in eval with binding

Added by Gat (Dawid Janczak) almost 11 years ago. Updated almost 11 years ago.


Description

Hello,
I think I might have found a bug concerning the new dir method.

Given binding (e.g. current top level binding) I would expect dir to return the directory I'm in, similarly to how FILE with binding does. Instead it returns nil.

I think I have found the solution, but since this is my first modification of Ruby code it might be inaccurate and not work in some cases. I hope it points to the right location though.
Please see attached patch along with a testcase showing the problem.

I also had to modify another testcase to use realpath when checking dir functionality, please check if it's correct.


Files

dir_eval.diff (1.39 KB) dir_eval.diff Gat (Dawid Janczak), 05/23/2013 02:31 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0