Project

General

Profile

Actions

Feature #642

closed

__DIR__

Added by trans (Thomas Sawyer) over 15 years ago. Updated almost 13 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:19313]

Description

=begin
There is an snippet of code found in many Ruby scripts, especially testing scripts. It is...

File.dirname(FILE)

For something so common --and something that can not, by its very nature, be put into a reusable method, it is annoying to have to repeatedly calculate the current scripts location. So I respectfully request that a future version of Ruby provide a built-in reference that can used instead:

DIR

This will improve readability, remove the need for extra variables to store this information, and at the very least, save us many a keystroke.
=end


Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #1961: Kernel#__dir__Closedmatz (Yukihiro Matsumoto)08/19/2009Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0