Issue #5422 has been updated by Thomas Sawyer.


I have. Obviously it's not earth shattering, but it really SHOULD be the same, so that glob functionality can be exactly emulated within code on arrays of strings. I've had need of this a couple of times.

----------------------------------------
Bug #5422: File.fnmatch != Dir.glob # {no,sets}
http://redmine.ruby-lang.org/issues/5422

Author: Suraj Kurapati
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 1.9.x
ruby -v: ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]


Hello,

The File.fnmatch methods do not support Dir.glob's set notation:

>> Dir.glob '{.g,t}*'
=> [".gem", "test"]
>> File.fnmatch? '{.g,t}*', 'test'
=> false
>> File.fnmatch? '{.g,t}*', '.gem'
=> false

Please add set notation to fnmatch() and make it equal to glob().

Thanks for your consideration.


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