View Source BeamMeta.Release.Otp (BeamMeta v0.1.0)

Functions for retrieving information related to Erlang/OTP releases.

This module does not deal with releases prior to version OTP 17.

Link to this section Summary

Types

A map that information related to a release in GitHub.

An Erlang/OTP release version.

Functions

Returns the latest stable Erlang/OTP version.

Returns a map which contains all the information that we find relevant from releases data.

Convert an Erlang/OTP version to the original string representation.

Returns a list with all the Erlang/OTP versions since OTP 17.

Link to this section Types

Specs

asset() :: :doc_html | :doc_man | :win32 | :win64

Specs

asset_data() :: %{
  content_type: mime_type :: String.t(),
  name: file_name :: String.t(),
  url: String.t()
}

Specs

release_data() ::
  BeamMeta.nonempty_keyword(
    version_key :: atom(),
    %{
      optional(:assets) => BeamMeta.nonempty_keyword(asset(), asset_data()),
      :latest? => boolean(),
      optional(:published_at) => DateTime.t(),
      optional(:url) => String.t(),
      version: version()
    }
  )

A map that information related to a release in GitHub.

This information is originally provided by BeamLangsMetaData.otp_releases/0 and is transformed.

Specs

version() :: Version.t()

An Erlang/OTP release version.

For example: #Version<24.2.0>.

Link to this section Functions

Specs

latest_version() :: version()

Returns the latest stable Erlang/OTP version.

Examples

> BeamMeta.Release.Otp.latest_version()
#Version<24.2.0>

Specs

release_data() :: release_data()

Returns a map which contains all the information that we find relevant from releases data.

Includes data from final releases and preseleases starting from OTP 17.

Examples

> BeamMeta.Release.Otp.release_data()
[
   "17.0": %{
    assets: [
      doc_html: %{
        content_type: "application/gzip",
        name: "otp_doc_html_17.0.tar.gz",
        url: "https://erlang.org/download/otp_doc_html_17.0.tar.gz"
      },
      doc_man: %{
        content_type: "application/gzip",
        name: "otp_doc_man_17.0.tar.gz",
        url: "https://erlang.org/download/otp_doc_man_17.0.tar.gz"
      },
      win32: %{
        content_type: "application/octet-stream",
        name: "otp_win32_17.0.exe",
        url: "https://erlang.org/download/otp_win32_17.0.exe"
      },
      win64: %{
        content_type: "application/octet-stream",
        name: "otp_win64_17.0.exe",
        url: "https://erlang.org/download/otp_win64_17.0.exe"
      }
    ],
    latest?: false,
    version: #Version<17.0.0>
  },
  "17.0.1": %{latest?: false, version: #Version<17.0.1>},
  "17.0.2": %{latest?: false, version: #Version<17.0.2>},
  "17.1": %{
    assets: [
      doc_html: %{...},
      doc_man: %{...},
      win32: %{...},
      win64: %{...},
    ],
    latest?: false,
    version: #Version<17.1.0>
  },
  ...,
  "24.1.7": %{
    assets: [
      doc_html: %{...},
      doc_man: %{...},
      win32: %{...},
      win64: %{...},
    ],
    latest?: false,
    published_at: ~U[2021-11-22 09:04:55Z], 
    url: "https://github.com/erlang/otp/releases/tag/OTP-24.1.7",
    version: #Version<24.1.7>
  },
  "24.2": %{
    assets: [
      doc_html: %{...},
      doc_man: %{...},
      win32: %{...},
      win64: %{...},
    ],
    latest?: true,
    published_at: ~U[2021-12-15 14:31:36Z],
    url: "https://github.com/erlang/otp/releases/tag/OTP-24.2",
    version: #Version<24.2.0>
  }
]
Link to this function

to_original_string(version)

View Source

Specs

to_original_string(Version.t()) :: String.t()

Convert an Erlang/OTP version to the original string representation.

Examples

iex> Version.parse!("23.3.4-10") |> BeamMeta.Release.Otp.to_original_string()
"23.3.4.10"

iex> Version.parse!("23.3.4-10.3") |> BeamMeta.Release.Otp.to_original_string()
"23.3.4.10.3"

iex> Version.parse!("25.0.0-rc0") |> BeamMeta.Release.Otp.to_original_string()
"25.0.0-rc0"

Specs

versions() :: [version(), ...]

Returns a list with all the Erlang/OTP versions since OTP 17.

The list contains the versions in string format, sorted ascendenly.

Examples:

> BeamMeta.Release.Otp.versions()
["17.0", "17.0.1", "17.0.2", "17.1", "17.1.1", "17.1.2", "17.2", "17.2.1",
 "17.2.2", "17.3", "17.3.1", "17.3.2", "17.3.3", "17.3.4", "17.4", "17.4.1",
 "17.5", "17.5.1", "17.5.2", "17.5.3", "17.5.4", "17.5.5", "17.5.6", ...]