[#76442] [Ruby trunk Feature#11741] Migrate Ruby to Git from Subversion — naruse@...
Issue #11741 has been updated by Yui NARUSE.
3 messages
2016/07/19
[#76515] [Ruby trunk Bug#12610] webrick: protect from httpoxy — nagachika00@...
Issue #12610 has been updated by Tomoyuki Chikanaga.
3 messages
2016/07/22
[ruby-core:76385] [Ruby trunk Feature#10121] Dir.empty?
From:
johncbackus@...
Date:
2016-07-18 04:01:37 UTC
List:
ruby-core #76385
Issue #10121 has been updated by John Backus. I commented this on #9969 as well. Given that `Dir.empty?` is being introduced I think it would be helpful to also introduce either `Pathname#empty?` (which would check if something is a file or a directory then do the respective empty check) or `Pathname#empty_directory?` (which would assume the path is referring to a directory). ---------------------------------------- Feature #10121: Dir.empty? https://bugs.ruby-lang.org/issues/10121#change-59633 * Author: Robert A. Heiler * Status: Closed * Priority: Normal * Assignee: Yukihiro Matsumoto ---------------------------------------- On IRC someone asked how to find out if a directory is empty or not, from within ruby. It seems as if there was no simple way. I suggest adding `Dir.empty?` On IRC, someone else suggested this: ~~~ruby Dir.entries(dir).size == 2 ~~~ I do not know if there are better ways but possibly that could be used for a `Dir.empty?` functionality? -- 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>