From: Thomas Leitner Date: 2007-05-18T04:35:04+09:00 Subject: Bug in Dir.glob in 1.8.6 on Windows? Hi, I got a bug report for webgen which appeared when the user change from ruby 1.8.5 to 1.8.6 using the One-Click-Ruby-Installer. Following is an extract from an IRB session under Windows with ruby 1.8.6: irb(main):005:0> Dir['src/**/**'] => ["src/about.de.page", "src/about.page", "src/default.css", "src/ defau lt.template", "src/images", "src/images/bodybg.gif", "src/images/ boxbg.g if", "src/images/greypx.gif", "src/images/header.jpg", "src/images/ inner bg.gif", "src/images/leaves.jpg", "src/images/tabs.gif", "src/ index.de.p age", "src/index.page", "src/links.de.page", "src/links.page"] irb(main):006:0> Dir['src/**/**/'] => ["src/", "src/about.de.page/", "src/about.page/", "src/ default.css/", "src/default.template/", "src/images/", "src/images/bodybg.gif/", "src/ images/boxbg.gif/", "src/images/greypx.gif/", "src/images/ header.jpg/", "src/images/innerbg.gif/", "src/images/leaves.jpg/", "src/images/ tabs.gi f/", "src/index.de.page/", "src/index.page/", "src/links.de.page/", "src /links.page/"] Why do all the files get a slash appended and why get files returned at all? I imagine that the second command should only return directories... at least this was the behaviour before 1.8.6 - same session on Windows with Ruby 1.8.5: irb(main):005:0> Dir['src/**/**'] => ["src/about.de.page", "src/about.page", "src/default.css", "src/ defau lt.template", "src/images", "src/index.de.page", "src/index.page", "src/ links.de.page", "src/links.page", "src/images/bodybg.gif", "src/images/ b oxbg.gif", "src/images/greypx.gif", "src/images/header.jpg", "src/ images /innerbg.gif", "src/images/leaves.jpg", "src/images/tabs.gif"] irb(main):006:0> Dir['src/**/**/'] => ["src/", "src/images/", "src/images/"] As you can see, this outputs the correct result, at least in my understanding. Has this behaviour already been seen/has anyone an explanation for this and does anyone know how to only get directories using Dir.[] in ruby 1.8.6 under Windows? Thanks for helping! Best regards, Thomas ps. Also tested this with Ruby 1.8.6 unde Mac OSX and there it works just fine!