-
-
Notifications
You must be signed in to change notification settings - Fork 200
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
Add new only_4xx
key to report just 4xx errors
#96
Conversation
Very nice. |
``` bash | ||
htmlproof '["http://github.com", "http://jekyllrb.com"]' | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
separate to this pr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I might just revert the change to the command line tool. I don't feel comfortable with the change. I think it's a silly option for Ruby, though.
Add new `only_4xx` key to report just 4xx errors
Wait are you proofing I figure I'd expect a different API for "can I access this website?" Like |
I absolutely agree with @parkr. The tool is a HTML proofer, so only static files should be first class citizens. |
The functionality for arbitrary link checking has been around since last month. I find it extremely useful in Rails apps for checking links in the UI, mailers, etc. In fact, both Pages and GitHub.com are starting to use Proofer for this very reason. The whole parallel link check set up with Typhoeus--checking as efficinetly and quickly as possible--is very useful for arbitrary links as well as those found in HTML docs. Having said all that, though, I agree now there should've been a different API for this. I'll likely do that in future major revision since it's a breaking change.
Indeed, but the link checking code is useful for arbitrary links and static files. Should it be put into its own gem? That way Proofer can use it for HTML files, and others can use it for arbitrary link checks. That makes sense to me, but I hope it doesn't become a maintenance nightmare. |
If you want to do it with Proofer, then @parkr’s proposal about API change is reasonable: # files
HTML::Proofer.file("./_site/**/*.html", {:only_4xx => true})
# arbitrary links
HTML::Proofer.ping(["http://example.com", "http://example.org"], {:only_4xx => true}) CLI with subcommands: # files
htmlproof file "./_site/**/*.html" --only-4xx
# arbitrary links
htmlproof ping "http://example.com","http://example.org" --only-4xx
A gem is too much. I would talk with @typhoeus about adding a //cc @i0rek |
Hey, I am not sure what |
An ask from GitHub. A few changes here:
as_link_array
option. Proofer should be smart enough to know that the first arg is an array.only_4xx
option is possible, which, if set, ensures that Proofer only reports errors for 4xx level problems./cc @penibelst @aroben