Settings.Frobs (fnord v0.8.83)

View Source

Manage frob enablement in settings.json using approvals-style arrays.

Schema:

  • Global: ["frobs"] :: [string]
  • Per-project: ["projects", pn, "frobs"] :: [string]

Effective enablement is the union of global and current project's frobs. All mutations are performed via Settings APIs that provide cross-process locking and atomic writes.

Summary

Functions

Disable a frob in the given scope. Idempotent.

Return the effective set of enabled frobs for the current project context (union of global and project lists).

Enable a frob in the given scope. Idempotent.

Is the given frob enabled (effective union)?

List enabled frobs for the given scope.

Prune missing frobs from settings based on the given list of present frob names.

Types

scope()

@type scope() :: :global | :project | {:project, String.t()}

Functions

disable(scope, name)

@spec disable(scope(), String.t()) :: :ok

Disable a frob in the given scope. Idempotent.

effective_enabled()

@spec effective_enabled() :: MapSet.t(String.t())

Return the effective set of enabled frobs for the current project context (union of global and project lists).

enable(scope, name)

@spec enable(scope(), String.t()) :: :ok

Enable a frob in the given scope. Idempotent.

enabled?(name)

@spec enabled?(String.t()) :: boolean()

Is the given frob enabled (effective union)?

list(arg1)

@spec list(scope()) :: [String.t()]

List enabled frobs for the given scope.

prune_missing!(present_names)

@spec prune_missing!([String.t()]) :: [String.t()]

Prune missing frobs from settings based on the given list of present frob names.

This removes any frob names that are not found in present_names from:

  • the global frobs array, and
  • the currently selected project's frobs array (if a project is selected)

Returns the list of names that were retained.