UPDATE: Understandably, a few feathers were ruffled by the above title. The truth is, Ruby’s core library smells like a rose. What stinks is the difficulty of writing cross-platform code that’s robust, secure, and high-performance. Don’t try to achieve all that with shell integration!
I’ve made some amendments (in bold type) to this post.
The other day my teammate said, “I finally found something that stinks about Ruby’s core library.”
What was wrinkling his nose? The Dir class gives you no way to ask for files only, or for directories only. He had a point. The Dir.entries is inflexible. And even the flexible Dir.glob method does not permit you to filter results by whether a filesystem entry is a directory or a file. You’re forced to inspect each entry individually.
Is this really a problem? Maybe not …
Maybe these questions do pose a problem in your application. You’ll have to venture beyond the core library for a solution. [Under Windows, anyway — dir provides options for filtering for directories or files, whereas ls does not.]
My favorite Rubyist, superhero James Edward Gray II, gave some very useful advice in his presentation at Lone Star Ruby Conference 2007. James proposed that leveraging the shell in your Ruby programs has an unnecessarily bad reputation.
Integrating with the shell can complicate or compromise portability. (Should I use ls or dir?) Shell integration also introduces points of failure. But both of these charges also can be made against use of libraries. [Scott Windsor correctly warns that execution of shell statements can pose a security threat to your system, so it should be approached with caution and avoided whenever possible.]
So let’s really press our luck and make a library out of some shell integration code! [This was hyperbole. I’m not writing a library here, just a little Windows-specific shell hack.]
Here’s an implementation I just wrote of the missing Dir.directories and Dir.files methods. Enjoy! 
I really disagree with Nils Jonsson’s take on ruby’s standard...so does matz. Nils...