Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Dir.glob instead of git ls-files #9

Merged
merged 2 commits into from May 20, 2020

Conversation

utkarsh2102
Copy link
Contributor

Hi,

This drops the unnecessary dependency of git.
I've been maintaining this in Debian and while building this, adding git as a dependency is useless if we can do the same thing with Dir.glob 馃殌

@nextmat
Copy link
Collaborator

nextmat commented May 13, 2020

Hmm, this isn't actually equivalent since it will include files ignored by git. How about this?

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

aggregate.gemspec Outdated Show resolved Hide resolved
@nextmat
Copy link
Collaborator

nextmat commented May 20, 2020

Thanks!

@nextmat nextmat merged commit bdcda58 into josephruscio:master May 20, 2020
@utkarsh2102
Copy link
Contributor Author

Hi @nextmat,

Hmm, this isn't actually equivalent since it will include files ignored by git. How about this?

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

Just wondering, how'd you do this if .gitignore had patterns and not files listed explicitly?

@nextmat
Copy link
Collaborator

nextmat commented Jun 2, 2020

@utkarsh2102 I believe FileList.exclude accepts a list of patterns, so it should work okay.

@utkarsh2102
Copy link
Contributor Author

@utkarsh2102 I believe FileList.exclude accepts a list of patterns, so it should work okay.

Oh no, I hit an obstacle when I was trying to use ! in the gitignore file :/
I opened this issue here: ruby/rake#356

@nextmat
Copy link
Collaborator

nextmat commented Jun 9, 2020

Oh no, I hit an obstacle when I was trying to use ! in the gitignore file :/
I opened this issue here: ruby/rake#356

Interesting, good to know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants