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

htmlproofer should set status codes to ints #319

Merged
merged 2 commits into from
Apr 1, 2016
Merged

htmlproofer should set status codes to ints #319

merged 2 commits into from
Apr 1, 2016

Conversation

parkr
Copy link
Contributor

@parkr parkr commented Mar 14, 2016

ignored_status_codes.include? 429 will be false if ignored_status_codes = ["429"]

@gjtorikian
Copy link
Owner

I like this. Thanks!

@@ -71,6 +71,8 @@ Mercenary.program(:htmlproofer) do |p|

options[:cache] = {}
options[:cache][:timeframe] = opts['timeframe'] unless opts['timeframe'].nil?

options[:http_status_ignore] = Array(options[:http_status_ignore]).map(&:to_i)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be options[:http_status_ignore].split(',') to get the array for multiple codes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You specify it as an Array so OptionsParser will give it to you as such. I tested it locally and it works. 😄

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test for it? In irb at least I get:

Array("421, 422").map(&:to_i)
=> [421]
irb(main):005:0> 

https://github.com/gjtorikian/html-proofer/blob/4434b7eecb19d869c59c92e6480661d18866253c/spec/html-proofer/command_spec.rb is where all the bin tests go. ❤️

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gjtorikian the input isn't "421, 422", it's ["421", "422"] I'll add a test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scratch that. @gjtorikian I can't use both VCR and the executable because the executable doesn't share the same Ruby env as the specs.

Trust that this line does what I'm saying it does?

@gjtorikian gjtorikian self-assigned this Mar 15, 2016
@gjtorikian
Copy link
Owner

Meh, I trust you. Sorry for the delay.

@gjtorikian gjtorikian merged commit 20836a9 into gjtorikian:master Apr 1, 2016
@parkr parkr deleted the patch-1 branch April 14, 2016 03:05
@parkr
Copy link
Contributor Author

parkr commented Apr 14, 2016

❤️

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.

2 participants