Conversation
It should be fully equivalent to the old one and not allow pre-releases.
lib/rubygems/specification_policy.rb
Outdated
| add_#{dep.type}_dependency '#{dep.name}', '~> #{base.join '.'}', '>= #{dep_version}' | ||
| if #{dep.name} is not semantically versioned, you can bypass this warning with: | ||
| add_#{dep.type}_dependency '#{dep.name}', '>= #{dep_version}', '< #{upper_bound.join '.'}' | ||
| add_#{dep.type}_dependency '#{dep.name}', '>= #{dep_version}', '< #{upper_bound.join '.'}.x' |
There was a problem hiding this comment.
why .x as the upper bound? This will continue to allow #{upper_bound}.a to be resolved, I believe
There was a problem hiding this comment.
Not sure why, but it works, I think I saw it somewhere. If I use < 5.2.x, it no longer allows 5.2.0.rc1 whereas < 5.2 allows it.
There was a problem hiding this comment.
is it because x is alphabetically before 0? 😂
There was a problem hiding this comment.
Funny I thought this was a feature and it seems like it's a bug 🤣.
If there's no "supported" equivalent of the semver operator using ">=", "<", then this advice is actually misleading...
There was a problem hiding this comment.
I only now understood @segiddins original comment. I'll do some more experiments to confirm if the actual non numeric digit is actually relevant. It seems better to use .a anyways since it's already used in other places.
Since it's documented at least in the test suite.
|
Turns out that |
4806a45 to
83552ed
Compare
|
@bundlerbot r+ |
|
📌 Commit 83552ed has been approved by |
Tweak warning recommendation # Description: In #2242 I introduced a recommendation to fix the semver warning in the case where the dependency is not semantically versioned. However, I think the recommendation was incorrect since, for example, `< 5.2` still allows `5.2.0.rc1`, whereas something like `~> 5.1.5` does not. I was bitten by this when I updated my dependencies according to the recommendation and the `rails-5.2.0.rc1` gem installed on my system was unintentionally activated. # Tasks: - [x] Describe the problem / feature - [x] Write tests - [x] Write code to solve the problem - [ ] Get code review from coworkers / friends I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).
|
☀️ Test successful - status-travis |
Description:
In #2242 I introduced a recommendation to fix the semver warning in the case where the dependency is not semantically versioned. However, I think the recommendation was incorrect since, for example,
< 5.2still allows5.2.0.rc1, whereas something like~> 5.1.5does not.I was bitten by this when I updated my dependencies according to the recommendation and the
rails-5.2.0.rc1gem installed on my system was unintentionally activated.Tasks:
I will abide by the code of conduct.