开发者

What does the ~> operator mean? [duplicate]

开发者 https://www.devze.com 2023-01-16 00:02 出处:网络
This question already has answers here: Closed 12 years ago. Possibl开发者_StackOverflow中文版e Duplicate:
This question already has answers here: Closed 12 years ago.

Possibl开发者_StackOverflow中文版e Duplicate:

Meaning of ~> in version requirement

I often stumble upon the ~> operator.

eg.

gem 'httparty', '~> 0.5.2'

What does it mean?


It's called a pessimistic version constraint. It matches a gem version by dropping the last digit and comparing equality. For example, ~> 0.5.2 would match version 0.5.2 or 0.5.3, but not 0.5 or 0.6. It's basically equivalent to a constraint of >= 0.5.2, < 0.6.


It means that any version >= 0.5.2 and < 0.6.0

Yehuda Katz recently wrote about this - http://yehudakatz.com/2010/08/21/using-considered-harmful-or-whats-wrong-with/

0

精彩评论

暂无评论...
验证码 换一张
取 消