You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if ~ and ~> were parsed as the same operator in composer. This would make it simpler for rubyists to walk in composer's world, without sacrificing anything for those already using composer.
Came across the below issue, which makes me think I'm understanding our current behaviour correctly, and that the suggestion would make sense: #1679
Hm. Seems npm's semver operator ~ works the same way as ruby's. Not sure why we don't all make our operators cross-compatible. I guess that's my suggestion then :)
First of all we can't really change this without breaking BC. That said, I don't think it needs changing. We do what bundler's ~> does, and we are close to what npm's ~ does, except where it disagrees with bundler.
constraint
composer
bundler
npm
summary
~1.2.3
>=1.2.3 && < 1.3.0
>=1.2.3 && < 1.3.0
>= 1.2.3 && < 1.3.0
all equal
~1.2
>=1.2.0 && < 2.0
>=1.2.0 && < 2.0
>=1.2.0 && < 1.3.0
npm differs
As I pointed out in that other issue, npm's ~1.2 behavior is equivalent to 1.2.* so I don't think it's particularly superior.
As for supporting ~ or ~>, I guess we could "support it" with a warning just so people mistyping it get nudged in the right direction. I don't think having two operators doing the same is a good thing.
It would be great if
~and~>were parsed as the same operator in composer. This would make it simpler for rubyists to walk in composer's world, without sacrificing anything for those already using composer.Came across the below issue, which makes me think I'm understanding our current behaviour correctly, and that the suggestion would make sense:
#1679
Here's an external explanation of the pessimistic operator, proving that they're the same thing in ruby-land.
http://robots.thoughtbot.com/rubys-pessimistic-operator
The text was updated successfully, but these errors were encountered: