Class: Factorix::Runtime
- Inherits:
-
Object
- Object
- Factorix::Runtime
- Defined in:
- lib/factorix/runtime.rb,
lib/factorix/runtime/wsl.rb,
lib/factorix/runtime/base.rb,
lib/factorix/runtime/linux.rb,
lib/factorix/runtime/mac_os.rb,
lib/factorix/runtime/windows.rb,
lib/factorix/runtime/user_configurable.rb
Overview
Factorio runtime environment abstraction
This class provides a factory method to detect the current platform and return the appropriate runtime environment instance.
Defined Under Namespace
Modules: UserConfigurable Classes: Base, Linux, MacOS, WSL, Windows
Class Method Summary collapse
-
.detect ⇒ Runtime::Base
Detect the current platform and return the appropriate runtime.
Class Method Details
.detect ⇒ Runtime::Base
Detect the current platform and return the appropriate runtime
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/factorix/runtime.rb', line 13 def self.detect case RUBY_PLATFORM when /darwin/ MacOS.new when /mingw|mswin/ Windows.new when /linux/ wsl? ? WSL.new : Linux.new else raise UnsupportedPlatformError, "Platform is not supported: #{RUBY_PLATFORM}" end end |