Project

General

Profile

Feature #12596

Add Pathname#empty? to be consistent with Dir.empty? and File.empty?

Added by backus (John Backus) over 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
[ruby-core:76404]

Description

#9969 and #10121 introduced Dir.empty? and File.empty?. It would be very useful if Pathname had an instance method for performing these same checks.

Since Pathname already has several methods which work for both files and directories (for example, Pathname#exist?) I propose adding Pathname#empty? which would work for expose the behavior that File.empty? and Dir.empty? provide.

I think this change especially makes sense given that, just like File.empty? was added as an alias of File.zero?, it seems like Pathname#zero? should also benefit from the same naming improvement provided by this alias.

History

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

  • Assignee changed from matz (Yukihiro Matsumoto) to akr (Akira Tanaka)

Updated by akr (Akira Tanaka) about 2 years ago

  • Status changed from Open to Closed

implemented at r56571

Also available in: Atom PDF