-
Notifications
You must be signed in to change notification settings - Fork 53
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
Allow http 5-x #55
Merged
Merged
Allow http 5-x #55
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
263e125
Allow Down::Http to be used with HTTP.rb 5.x
mgrunberg 361bb6d
Remove Warning.ignore. http-parser is not a dependency anymore
mgrunberg a44b109
Update readme: use http 5.0
mgrunberg 9d2d92f
Use http 4.x for ruby 2.4 and 2.3
mgrunberg 909e06c
add a comment
mgrunberg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Use http 4.x for ruby 2.4 and 2.3
- Loading branch information
commit 9d2d92f7d7b593a6a0db05dee8abde80defa6455
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 doesn't actually work to do what you want, I'm afraid.
Logic in a gemspec is executed at build time, so which of these gets included will depend on what version of ruby the releaser was using.
There isn't any way to do conditional logic in a gemspec like this that applies at runtime/execution time different for different apps.
However... I'm confused that this is only a development dependency not an actual runtime dependency... maybe this is ok? Is this really only about CI? But it's very confusing/misleading, and will result in a gem released to rubygems whose
development_dependency
for http depends on what version of ruby the releaser was running...I am not sure what to do, but I think ideally there is a different solution than this. Or at least some very explicit comments. Because this sort of thing is an error people make in gemspecs a lot, and 99% of the time it is an error, and causes big problems.
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 will try to do my best to explain what lead me to this solution.
down
has several backends (readme). You don't always needhttp
gem to usedown
. If you use the default backend, there is no point in addinghttp
to your system. This is by, as I understand, it's not a gemspecdependency
.It's needed as a
development_dependency
to testDown::Http
backend. But also because some specs use it to build the expected result (example) and becausetest_helper
uses it to wait for a service.Since
http
drop ruby 2.3 and 2.4 supportdown
could do the same. That's fair. But users running old rubies (2.3 and 2.4 have reached EOL) can still useDown::Http
if they use4.x
version. Drop old rubies support is not a requirement to use http 5.0, so I took the conservative alternative and let specs run with 4.x on old rubies (asserting that this works).Why the condition logic is in the gemspec and not in another place (Gemfile for example)? Because there are already some
development_dependencies
handled that way.