View Source GitHubActions.Project (GitHubActions v0.2.20)

A thin wrapper for Mix.Project to access the config.

Summary

Functions

Returns the Elixir version of the current project.

Returns the value for given keys from the project config, in a tuple.

Returns the value for given keys from the project config, raises an error if keys are not available.

Returns the value for given keys from the project config.

Returns true if the given dep is part of the project.

Types

@type default() :: any()
@type key() :: atom()
@type keys() :: [atom()]
@type value() :: any()

Functions

See Mix.Project.config/0.

@spec elixir() :: String.t()

Returns the Elixir version of the current project.

Examples

iex> Project.elixir()
"~> 1.11"
@spec fetch(key() | keys()) :: {:ok, value()} | :error

Returns the value for given keys from the project config, in a tuple.

Examples

iex> Project.fetch(:app)
{:ok, :git_hub_actions}

iex> Project.fetch(:unknown)
:error

iex> Project.fetch([:test_coverage, :tool])
{:ok, ExCoveralls}
@spec fetch!(key() | keys()) :: value()

Returns the value for given keys from the project config, raises an error if keys are not available.

Examples

iex> Project.fetch!(:app)
:git_hub_actions

iex> Project.fetch!([:test_coverage, :tool])
ExCoveralls
Link to this function

get(keys, default \\ nil)

View Source
@spec get(key() | keys(), default()) :: value()

Returns the value for given keys from the project config.

Examples

iex> Project.get(:app)
:git_hub_actions

iex> Project.get(:unknown, 42)
42

iex> Project.get([:test_coverage, :tool])
ExCoveralls
@spec has_dep?(atom()) :: boolean()

Returns true if the given dep is part of the project.

Examples

iex> Project.has_dep?(:credo)
true

iex> Project.has_dep?(:datix)
false