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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange behavior of include_files? #8

Closed
utkarsh2102 opened this issue Jun 3, 2020 · 3 comments
Closed

Strange behavior of include_files? #8

utkarsh2102 opened this issue Jun 3, 2020 · 3 comments

Comments

@utkarsh2102
Copy link
Contributor

Hi,

Thanks for your work on fast_ignore!
Whilst experimenting with it, I came across this:

irb(main):001:0> require 'fast_ignore'
=> true
irb(main):002:0> FastIgnore.new(include_files: 'README.md', relative: true).to_a
=> ["bin/console", "bin/time", "bin/ls_seconds", "bin/ls"]

I am not sure if it's expected? Or am I missing something obvious?

@robotdana
Copy link
Owner

include_files means read the README.md file as list of gitignore style patterns, it doesn't describe a pattern itself (that would be include_rules). Most of this file is invalid as a gitignore file, but it does have as an example a line containing only #!:ruby. This is then interpreted by the custom shebang pattern matching.

I'll add this line to the documentation for ignore_files and include_files, do you think that will suffice?
This is a list of files in the gitignore format to parse and match paths against, not a list of files to ignore/include

@utkarsh2102
Copy link
Contributor Author

Hi,

include_files means read the README.md file as list of gitignore style patterns, it doesn't describe a pattern itself (that would be include_rules). Most of this file is invalid as a gitignore file, but it does have as an example a line containing only #!:ruby. This is then interpreted by the custom shebang pattern matching.

Ah, I see.

I'll add this line to the documentation for ignore_files and include_files, do you think that will suffice?
This is a list of files in the gitignore format to parse and match paths against, not a list of files to ignore/include

Yeah, I think this should do.
Maybe you could add "you might want to use include_rules instead" at the end of the above statement so that the people know that they want to use include_rules instead of include_files whenever they're in such a dilemma.

@robotdana
Copy link
Owner

yes that’s a great addition thank you

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

No branches or pull requests

2 participants