Humphrey Alba wrote:
> Dir.foreach("/tmp") {|f| puts f if File.directory?(f) }
> -- it just prints '.' and '..'

Dir.foreach("/tmp") {|f| puts f if File.directory?("/tmp/#{f}") }
or
Dir.chdir("/tmp") do
  Dir.foreach(".") {|f| puts f if File.directory?(f) }
end
or
Dir.glob("/tmp/*") {|f| puts f if File.directory?(f) }
or
Dir.glob("/tmp/*/") {|f| puts f}
or
puts Dir.glob("/tmp/*/")
or
puts Dir["/tmp/*/"]

The glob-ones will not include hidden directories or . and .. and they will 
print the full-path to the dir (though you could also use chdir with glob, if 
you don't want the full path).

HTH,
Sebastian