Module: Factorix::Runtime::UserConfigurable

Included in:
Base
Defined in:
lib/factorix/runtime/user_configurable.rb

Overview

Provides user-configurable path overrides for Runtime

This module is prepended to Runtime::Base to allow users to override auto-detected paths via configuration. When a configured path is available, it is used instead of platform-specific auto-detection.

Configuration is done via Factorix.config:

All path resolution decisions are logged at DEBUG level.

Examples:

Configure paths in config file

Factorix.configure do |config|
  config.runtime.executable_path = "/opt/factorio/bin/x64/factorio"
  config.runtime.user_dir = "/home/user/.factorio"
end

Instance Method Summary collapse

Instance Method Details

#data_dirPathname

Get the Factorio data directory path

Returns the configured data_dir if available, otherwise falls back to platform-specific auto-detection.

Returns:

  • (Pathname)

    the Factorio data directory

Raises:

  • (ConfigurationError)

    if auto-detection is not supported and no configuration is provided



46
# File 'lib/factorix/runtime/user_configurable.rb', line 46

def data_dir = configurable_path(:data_dir, example_path: "/path/to/factorio/data") { super }

#executable_pathPathname

Get the Factorio executable path

Returns the configured executable path if available, otherwise falls back to platform-specific auto-detection.

Returns:

  • (Pathname)

    the Factorio executable path

Raises:

  • (ConfigurationError)

    if auto-detection is not supported and no configuration is provided



28
# File 'lib/factorix/runtime/user_configurable.rb', line 28

def executable_path = configurable_path(:executable_path, example_path: "/path/to/factorio") { super }

#user_dirPathname

Get the Factorio user directory path

Returns the configured user_dir if available, otherwise falls back to platform-specific auto-detection.

Returns:

  • (Pathname)

    the Factorio user directory

Raises:

  • (ConfigurationError)

    if auto-detection is not supported and no configuration is provided



37
# File 'lib/factorix/runtime/user_configurable.rb', line 37

def user_dir = configurable_path(:user_dir, example_path: "/path/to/factorio/user/dir") { super }