Juggernaut.Config.Mutare (Juggernaut v0.4.0)

Copy Markdown View Source

Converts a Mutare 0.5.1 .mutare.exs to Juggernaut configuration (design notes §3, mix juggernaut.install --from-mutare).

Only call_routes carries over. A route is {Mod, :fun, treatment} or {Mod, :fun, arity, treatment}:

  • :raw becomes a raw_calls entry (arguments never mutated);
  • :skip becomes a skip_calls entry;
  • a list of per-argument treatments becomes a raw_calls entry with the positions marked :raw, when every other position is :expression (mutated as usual);
  • anything else is a warning naming the route, and is not converted.

Other .mutare.exs keys are listed in a warning: they have no Juggernaut equivalent or are covered by defaults (mutare:ignore comments keep working unchanged).

Summary

Functions

Converts an evaluated .mutare.exs keyword list.

Evaluates the contents of a .mutare.exs file.

Types

conversion()

@type conversion() :: %{
  raw_calls: [tuple()],
  skip_calls: [tuple()],
  warnings: [String.t()]
}

Functions

convert(config)

@spec convert(term()) :: conversion()

Converts an evaluated .mutare.exs keyword list.

parse(contents)

@spec parse(String.t()) :: {:ok, term()} | {:error, String.t()}

Evaluates the contents of a .mutare.exs file.