I've got code working to do what I want but I'm hoping there is a 
better way.  Mine seems clumsy.

My goal is to search over all files,  identify all that are directories 
and then do something to each directory.  I don't need to go into 
directories recursively yet.

The fact that Dir.foreach returns strings seems odd to me.  All advice 
appreciated.


#!/usr/local/bin/ruby

dpath = Dir.getwd

Dir.foreach(dpath) do
  |x|
  ddir = File.join(dpath,x)
  if File.directory?(ddir) && x != "." && x != ".." then
    puts %x{du -sh #{x}}
  end
end