Module: Lich::Common::SessionLauncher
- Defined in:
- documented/common/session_launcher.rb
Constant Summary collapse
- OPTIONAL_PATH_FLAGS =
[ { option: 'home', key: :home_dir, constant: :LICH_DIR }, { option: 'data', key: :data_dir, constant: :DATA_DIR }, { option: 'scripts', key: :script_dir, constant: :SCRIPT_DIR }, { option: 'temp', key: :temp_dir, constant: :TEMP_DIR }, { option: 'maps', key: :map_dir, constant: :MAP_DIR }, { option: 'logs', key: :log_dir, constant: :LOG_DIR }, { option: 'backup', key: :backup_dir, constant: :BACKUP_DIR }, { option: 'lib', key: :lib_dir, constant: :LIB_DIR } ].freeze
Class Method Summary collapse
-
.launch(launch_data, launch_context: nil) ⇒ Hash
Launches a new session process with the given launch data.
Class Method Details
.launch(launch_data, launch_context: nil) ⇒ Hash
Launches a new session process with the given launch data.
32 33 34 35 36 37 38 39 40 41 |
# File 'documented/common/session_launcher.rb', line 32 def launch(launch_data, launch_context: nil) unless launch_data.is_a?(Array) && launch_data.any? return { ok: false, error: 'launch_data must be a non-empty Array' } end pid = spawn_process(launch_data, launch_context: launch_context) { ok: true, pid: pid } rescue StandardError => e { ok: false, error: e. } end |