-
-
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
Support Typhoeus options from command line #490
Support Typhoeus options from command line #490
Conversation
As of this point, when testing locally, the following command works as expected:
I see a longer timeout and verbose output. So it does appear that this is parsing the JSON, passing it through, and mapping it on top of the defaults that html-proofer is supplying. I know it's a far cry from being ready to go yet, but that result is encouraging. |
I noticed that the Travis CI build failed. Upon inspection, those appear to be two unrelated rubocop findings in areas I haven't modified. If you believe it's something to do with this PR, let me know and I'll be happy to modify. |
Hey, this is looking good!
Thanks for that report. I merged a fix into If you update your branch, the tests should pass. I think the only thing keeping this from being merged in, really are spec tests; I'd also really like to see a |
@gjtorikian thanks for the feedback and being receptive to the PR! At first glance the spec updates seem doable for sure, just going to take a little time with it due to less familiarity with Ruby in general. I figure I'll do a few and then you can suggest others I may have missed? |
@gjtorikian hey! I'm looking into this and I don't see any specs set up specifically around the mercenary configuration and testing options, etc. I started testing Am I missing the location of those specs? If they don't exist, would you prefer I:
Normally the first option would be my preference, but given the lack of familiarity I wonder if that's a heavy lift for this PR given my familiarity. Happen to take a stab at it if you prefer though. |
@gjtorikian I extracted the functionality into a new function that I'm hoping I can write specs around. Pushed some changes including empty specs and the beginnings of the refactor. Look good? |
Codecov Report
@@ Coverage Diff @@
## master #490 +/- ##
==========================================
+ Coverage 98.27% 98.31% +0.03%
==========================================
Files 27 28 +1
Lines 1802 1838 +36
==========================================
+ Hits 1771 1807 +36
Misses 31 31
Continue to review full report at Codecov.
|
Apologies if you're getting push notifications on this -- I'm doing my dev in windows for convenience and need to push the changes so I can test them in my Ubuntu WSL instance, so there's some noise as I work through stuff. I'll definitely be squashing these changes. |
d7f1b67
to
6b1aea7
Compare
@gjtorikian I think this might be ready to go -- as far as I can tell, all the related specs pass on my local (one unrelated spec is failing but appears to be to due more with a timeout). I rebased to squash & clean stuff up as well. Would love your review when you get the chance! |
@gjtorikian I think this is ready to go, so just checking in. The build is failing but my understanding is it's an unrelated timeout on an existing case and not due to my changes. I'll double-check to make sure. Update: nevermind I can see the build output now and I see there's some rubocop violations to clean up. working on it now! |
30cf70d
to
a2d322f
Compare
@gjtorikian OK, I fixed all the rubocop issues and then rebased to squash / include them all in the larger commit. Now truly green & passing. ✅ |
@gjtorikian wanted to check in on this. I'm sure you're probably busy, but I'd love to get it in soon or shore it up if you feel it's missing something. Or if it needs to wait for a bit, let me know and I'll stop bugging you. :)
|
@gjtorikian any word on this? |
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.
This looks good to me!
Thanks @Floppy! @gjtorikian let me know if you think anything else is needed here. |
@gjtorikian checking in one more time on this. ✅ Build passing Are there any hesitations I could address? Or would it be possible to get this merged soon? Happy to address any questions or concerns. |
Hi, I'm very sorry for my delay in review here for this much requested feature! Personal life got in the way of open source, I'm afraid. This looks nearly perfect--I simply moved the Thank you so much for this contribution! And again, I'm sorry it took me so long to get back to you. |
No worries at all! I totally understand and I'm all about work-life balance. 👍 Glad this is useful and was able to make it in! |
Hi all,
First off -- thanks for a great tool! It's useful enough that I went out of my way to use it for my Jekyll blog recently.
I noticed that there appear to have been some requests previously to support Typhoeus options from the command-line. I would also find this quite useful, even though we can currently use a ruby script to obtain the same things.
I figured I would take a shot at contributing this feature as an exercise to expand my own ruby capabilities as well as contribute something back that I and others have expressed interest in.
Along the way, I am open to guidance and direction. And I intend to ensure the specs are covered to your satisfaction.
Suggested Feature Set (as I understand it)
--typhoeus-config CONFIG
with a JSON-formatted config string which we then pass directly in as typhoeus options to the original options object. This is then merged with the defaults.NOTE: I've examined proposing this with both a command line and a config file option, but am choosing to limit this PR to the cmdline option (will do a follow-up PR for allowing a file if the support is there for adding it).
Example Usage
bundle exec htmlproofer --typhoeus-config '{ "timeout": 100 }' ./_site
To Do (as I understand it)
--typhoeus-config
option to mercenary wiring.json
as a dependency (to parse the json)Specs