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_64Fallback Chain
Binary resolution follows this priority:
Application.get_env(:ex_maude, :maude_path)- Explicit configpriv/maude/bin/maude-{platform}- Bundled binarySystem.find_executable("maude")- System PATH- 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
@spec bundled?() :: boolean()
Checks if a bundled Maude binary is available for the current platform.
@spec bundled_path() :: Path.t() | nil
Returns the path to the bundled Maude binary for the current platform, or nil.
@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.
@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"
@spec platform() :: String.t()
Returns the current platform identifier.
Examples
ExMaude.Binary.platform()
#=> "darwin-arm64"
@spec priv_dir() :: Path.t()
Returns the priv directory path for ExMaude.
@spec supported_platform?() :: boolean()
Checks if the current platform is supported.
@spec supported_platforms() :: [String.t()]
Returns all supported platforms.
@spec version() :: String.t()
Returns the bundled Maude version.