How does the pessimistic version operator (~>) in Ruby handle alpha/beta versions?

百般思念 提交于 2019-12-06 09:30:56

I ran a couple of quick tests in irb with the following pattern:

Gem::Requirement.new("~> 2.0.0.alpha.4").satisfied_by?(Gem::Version.new("[version.string.to.test]"))

For instance:

irb(main):001:0> Gem::Requirement.new("~> 2.0.0.alpha.4").satisfied_by?(Gem::Version.new("2.0.1"))
=> true

These tests show that "~> 2.0.0.alpha.4" matches version numbers up to, but not including, "2.1.0".

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!