Gem dependencies versions meaning

2019-03-11 01:57发布

Gem dependency version can be specified with prefixes =, <, >, <=, >= and ~>. I understand all except last one, what does ~> mean?

标签: ruby version gem
1条回答
家丑人穷心不美
2楼-- · 2019-03-11 02:30

The ~> operator means: match within the same version, depending on how specific you want it to be, here's some examples:

 Specification From  ... To (exclusive)
  ">= 3.0"      3.0   ... &infin;
  "~> 3.0"      3.0   ... 4.0
  "~> 3.0.0"    3.0.0 ... 3.1
  "~> 3.5"      3.5   ... 4.0
  "~> 3.5.0"    3.5.0 ... 3.6

Source

查看更多
登录 后发表回答