Issue #8006 has been updated by gettalong (Thomas Leitner).


=begin
For your information, I have fixed this problem in my code, see the  ((<commit on Github|URL:https://github.com/gettalong/webgen/commit/8c49da9143569c8b68d6172199e12a9b8274e5bd>)).

Would be good, though, to know whether this is intentional or not.

Thanks!
=end
----------------------------------------
Bug #8006: Dir.glob behaves differently on 1.9.3 and 2.0
https://bugs.ruby-lang.org/issues/8006#change-37452

Author: gettalong (Thomas Leitner)
Status: Open
Priority: Low
Assignee: nobu (Nobuyoshi Nakada)
Category: core
Target version: 
ruby -v: ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]


=begin
While testing an application of mine with Ruby 2.0 I came across the following problem with Dir.glob where the pattern `FOO/BAR/**/*` does not match the directory `FOO/BAR` anymore because the implicit directories '.' and '..' don't get matched anymore.

Used files:

 $ find data/webgen/basic_website_template/
 data/webgen/basic_website_template/
 data/webgen/basic_website_template/ext
 data/webgen/basic_website_template/ext/init.rb
 data/webgen/basic_website_template/webgen.config
 data/webgen/basic_website_template/src
 data/webgen/basic_website_template/src/.gitignore

With Ruby 1.9.3-p327:

  1.9.3-p327 :001 > Dir.glob('data/webgen/basic_website_template/**/*', File::FNM_PATHNAME|File::FNM_DOTMATCH|File::FNM_CASEFOLD)
   => ["data/webgen/basic_website_template/.", "data/webgen/basic_website_template/ext", "data/webgen/basic_website_template/ext/.", "data/webgen/basic_website_template/ext/..", "data/webgen/basic_website_template/ext/init.rb", "data/webgen/basic_website_template/..", "data/webgen/basic_website_template/webgen.config", "data/webgen/basic_website_template/src", "data/webgen/basic_website_template/src/.", "data/webgen/basic_website_template/src/..", "data/webgen/basic_website_template/src/.gitignore"] 
1.9.3-p327 :003 > 

With Ruby 2.0.0-p0:

  2.0.0-p0 :001 > Dir.glob('data/webgen/basic_website_template/**/*', File::FNM_PATHNAME|File::FNM_DOTMATCH|File::FNM_CASEFOLD)
   => ["data/webgen/basic_website_template/ext", "data/webgen/basic_website_template/ext/init.rb", "data/webgen/basic_website_template/webgen.config", "data/webgen/basic_website_template/src", "data/webgen/basic_website_template/src/.gitignore"]

=end



-- 
http://bugs.ruby-lang.org/