Hallo,

Today I did a lot of searching and experimenting with different things that could potentially fix the usage of git ls-files.

Whilst there are a lot of possible alternatives for using pure Ruby, the problem is that they don’t “respect” the .gitignore file.

So whilst exploring, I stumbled upon using rake/file_list.
Something like this:

require 'rake/file_list'
spec.files = Rake::FileList['**/*'].exclude(*File.read('.gitignore').split)

To my surprise, it handles patterns quite well:

FileList['a.c', 'b.c'].exclude(/^a/)  => ['b.c']
FileList['a.c', 'b.c'].exclude("a.*") => ['b.c']

However, it doesn’t quite support all the rules, like using !, et al.

Thanks to David, I stumbled upon a very nice gem, fast_ignore.
This seems to be a eureka moment, I believe!? :o

Whilst I did some experiments with this, too, I am yet to look more on this.
I hope tomorrow :)


:wq for today.