Hi eveyone,
I am looking to match all versions above 1.11
including 1.11.0-rc0
, any idea how to achieve this?
iex(35)> Version.match?("1.11.0-rc1", "~> 1.11")
false
iex(36)> Version.match?("1.11.0-rc1", "~> 1.11", allow_pre: true)
false
iex(37)> Version.match?("1.11.0-rc1", ">= 1.11", allow_pre: true)
** (Version.InvalidRequirementError) invalid requirement: ">= 1.11"
(elixir 1.13.0-rc.1) lib/version.ex:433: Version.parse_requirement!/1
(elixir 1.13.0-rc.1) lib/version.ex:278: Version.match?/3
iex(37)> Version.match?("1.11.0-rc1", ">= 1.11.0", allow_pre: true)
false
iex(38)> Version.match?("1.11.0-rc1", ">= 1.11-0")
** (Version.InvalidRequirementError) invalid requirement: ">= 1.11-0"
(elixir 1.13.0-rc.1) lib/version.ex:433: Version.parse_requirement!/1
(elixir 1.13.0-rc.1) lib/version.ex:278: Version.match?/3
The only way to achieve this, is by using the lowest prerelease that I could come up with -0
which is a bit hackish but gets the job done.
iex(38)> Version.match?("1.11.0-rc1", ">= 1.11.0-0")
true
iex(39)> Version.match?("1.12.0", ">= 1.11.0-0")
true
iex(41)> Version.match?("1.11.0-rc1", "~> 1.11-0")
true
iex(41)> Version.match?("1.12.0", "~> 1.11-0")
true
Is there anything that I am missing?