From 17cb3bbb299df1f174cf7cb924f0030596f9a645 Mon Sep 17 00:00:00 2001 From: Wojtek Mach Date: Thu, 27 Jun 2024 10:06:18 +0200 Subject: [PATCH] Fix version check for Elixir Prior to this patch, we couldn't use this package because it was crashing when using Elixir pre-releases (here, 1.18.0-dev): == Compilation error in file lib/x509/logger.ex == ** (ArgumentError) errors were found at the given arguments: * 1st argument: not a textual representation of an integer :erlang.binary_to_integer("0-dev") (elixir 1.18.0-dev) lib/enum.ex:1703: Enum."-map/2-lists^map/1-1-"/2 (elixir 1.18.0-dev) lib/enum.ex:1703: Enum."-map/2-lists^map/1-1-"/2 lib/x509/logger.ex:7: (module) This is now fixed. `X509.Util.app_version/1` is still used in a couple other places but just for applications that ship with OTP and they should not have this problem. --- lib/x509/logger.ex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/x509/logger.ex b/lib/x509/logger.ex index 110cf40..046840e 100644 --- a/lib/x509/logger.ex +++ b/lib/x509/logger.ex @@ -1,10 +1,9 @@ defmodule X509.Logger do @moduledoc false - alias X509.Util require Logger - if Util.app_version(:logger) >= [1, 11, 0] do + if Version.match?(System.version(), ">= 1.11.0") do def warn(message, metadata \\ []) do Logger.warning(message, metadata) end