rake
rake copied to clipboard
[REGRESSION] FileList['[A-Z]*'] matches files starting with lower case character on default OS X file system using Ruby 2.2
The default OS X file system is case-aware, and casing used to be respected in FileList.
Including only files starting with an upper case character in gems is a very common use case which should have continued support by Rake.
spec.files = FileList['[A-Z]*', 'bin/*', 'lib/**/*', 'test/**/*'].to_a
Rake uses glob and has for years (see @698a54980ef0e7f84447ee67f865366f56f2857a) so I think this comes from the glob changes in Ruby 2.2 since I don't see or remember rake changes to FileList resolution.
To check, does latest rake behave the same on Ruby 2.1? This way we can determine where the regression lies.
(See the ruby 2.2 ChangeLog for the glob changes on case insensitive filesystems)
Yes, it is the change in Ruby 2.2 that does the change in FileList. Should this behavior bleed through?
Is there a way to get the old behavior back with FileList, or do we have to resort to
spec.files = FileList['[A-Z]*'].select{|f| f =~ /^[A-Z]/} + FileList['bin/*', 'lib/**/*', 'test/**/*'].to_a
It seems not Rake issue.