Project

General

Profile

Feature #12194

File.dirname optional parameter

Added by nobu (Nobuyoshi Nakada) about 4 years ago. Updated about 4 years ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:74448]

Description

As talked at the last developers' meeting, I propose an addition of an optional parameter to File.dirname.

Often I see the code, like

File.dirname(File.dirname(path)) # or
File.expand_path("../..", path)

which are not concise.

This proposal can make them as:

File.dirname(path, 2)

https://github.com/ruby/ruby/compare/trunk...nobu:feature/dirname-level?expand=1

Also available in: Atom PDF