Project

General

Profile

Actions

Backport #6977

closed

Ruby 1.9.3 Dir.glob strange recursive match behaviour

Added by jasonling (Jason Ling) over 11 years ago. Updated about 11 years ago.

Status:
Closed
[ruby-core:47418]

Description

Assuming a directory structure of:

a/b/c/d/e/f/g/h

I am trying to find 'h' via:

Dir.glob('a/**/f/g/h')

However this is not working. Any ideas?

You can try the test case below:

$ /usr/bin/ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
$ mkdir -p a/b/c/d/e/f/g/h
$ ruby -e "puts Dir.glob('a//*')"
a/b
a/b/c
a/b/c/d
a/b/c/d/e
a/b/c/d/e/f
a/b/c/d/e/f/g
a/b/c/d/e/f/g/h
$ ruby -e "puts Dir.glob('a/
/h')"
a/b/c/d/e/f/g/h
$ ruby -e "puts Dir.glob('a//g/h')"
a/b/c/d/e/f/g/h
$ ruby -e "puts Dir.glob('a/
/f/g/h')"
nothing

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0