[ruby-core:79071] [Ruby trunk Bug#13126] __dir__ in eval returns nil

From: sc-ruby-lang@...
Date: 2017-01-13 15:54:06 UTC
List: ruby-core #79071
Issue #13126 has been updated by Artem Shein.


Shyouhei Urabe wrote:
> Can you show us your expectation?  Should what be the value for __dir__ inside of an eval?

It should be the same as File.dirname(__FILE__).

----------------------------------------
Bug #13126: __dir__ in eval returns nil
https://bugs.ruby-lang.org/issues/13126#change-62481

* Author: Artem Shein
* Status: Feedback
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
~~~
$ ruby -e 'eval "p File.dirname(__FILE__); p __dir__"'
"."
nil
~~~




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next