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

file_ignore list only looks at first argument ? #145

Closed
ahgittin opened this issue Jan 20, 2015 · 2 comments · Fixed by #153
Closed

file_ignore list only looks at first argument ? #145

ahgittin opened this issue Jan 20, 2015 · 2 comments · Fixed by #153

Comments

@ahgittin
Copy link

is there a bug in the way multiple entries in the file_ignore list are handled? it looks like only the first item in the list is respected.

(then again it's entirely possible i've misunderstood how regex arrays are written in ruby -- apologies if so)

the issue is that this works to exclude ../catalog/.. items:

  :file_ignore => [ /.*\/(javadoc|catalog)\/.*/ ]

but this does not:

  :file_ignore => [ /.*\/javadoc\/.*/, /.*\/catalog\/.*/ ]
@gjtorikian
Copy link
Owner

Nope, it looks like file_ignore definitely iterates over each item:

@options[:file_ignore].each do |pattern|
if pattern.is_a? String
return pattern == file
elsif pattern.is_a? Regexp
return pattern =~ file
end
end

Your regexp also looks right to me. I just noticed my test doesn't check for a list of ignore patterns, it only has a first item--so let me add a new test and see how that goes.

@gjtorikian
Copy link
Owner

@ahgittin Well, you were right! The array wasn't iterating for some reason. A fix is made in #153, and should be released in HTML-Proofer 2.0 🔜

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 a pull request may close this issue.

2 participants