ExMaude.Binary (ExMaude v0.2.0)

View Source

Maude binary management and platform detection.

This module handles locating and managing Maude executables, with support for:

  • Bundled platform-specific binaries
  • System PATH detection
  • Custom path configuration

Bundled Binaries

ExMaude bundles Maude binaries for common platforms in priv/maude/bin/:

priv/maude/bin/
 maude-darwin-arm64    # macOS Apple Silicon
 maude-darwin-x64      # macOS Intel
 maude-linux-x64       # Linux x86_64

Fallback Chain

Binary resolution follows this priority:

  1. Application.get_env(:ex_maude, :maude_path) - Explicit config
  2. priv/maude/bin/maude-{platform} - Bundled binary
  3. System.find_executable("maude") - System PATH
  4. Raises error with install instructions

Examples

# Get the Maude binary path
ExMaude.Binary.path()
#=> "/path/to/ex_maude/priv/maude/bin/maude-darwin-arm64"

# Check if bundled binary is available
ExMaude.Binary.bundled?()
#=> true

# Get current platform
ExMaude.Binary.platform()
#=> "darwin-arm64"

Summary

Functions

Checks if a bundled Maude binary is available for the current platform.

Returns the path to the bundled Maude binary for the current platform, or nil.

Returns the path to the Maude binary, or nil if not found.

Returns the path to the Maude binary.

Returns the current platform identifier.

Returns the priv directory path for ExMaude.

Checks if the current platform is supported.

Returns all supported platforms.

Returns the bundled Maude version.

Functions

bundled?()

@spec bundled?() :: boolean()

Checks if a bundled Maude binary is available for the current platform.

bundled_path()

@spec bundled_path() :: Path.t() | nil

Returns the path to the bundled Maude binary for the current platform, or nil.

find()

@spec find() :: Path.t() | nil

Returns the path to the Maude binary, or nil if not found.

Unlike path/0, this does not raise an error.

path()

@spec path() :: Path.t()

Returns the path to the Maude binary.

Follows the fallback chain: config → bundled → system → error.

Examples

ExMaude.Binary.path()
#=> "/path/to/maude"

platform()

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

Returns the current platform identifier.

Examples

ExMaude.Binary.platform()
#=> "darwin-arm64"

priv_dir()

@spec priv_dir() :: Path.t()

Returns the priv directory path for ExMaude.

supported_platform?()

@spec supported_platform?() :: boolean()

Checks if the current platform is supported.

supported_platforms()

@spec supported_platforms() :: [String.t()]

Returns all supported platforms.

version()

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

Returns the bundled Maude version.