ExQuality.Init.VersionResolver (ExQuality v0.2.0)
View SourceResolves latest package versions from hex.pm.
Uses mix hex.info <package> to fetch version information and parses
the recommended version string from the output.
Summary
Functions
Fetches latest versions for the given tools.
Returns a map of tool -> {package_name, version_spec}.
Examples
fetch_versions([:credo, :dialyzer])
#=> %{
credo: {:credo, "~> 1.7"},
dialyzer: {:dialyxir, "~> 1.4"}
}
Parses version from hex.info output.
Looks for the Config line which contains the recommended version string.
Examples
output = """
Config: {:credo, "~> 1.7"}
Locked version: 1.7.15
Releases: 1.7.15, 1.7.14, ...
"""
parse_version_from_output(output)
#=> "~> 1.7"Falls back to parsing the Releases line if Config is not found, and uses "~> 0.1" as a last resort.