File: system.rb

package info (click to toggle)
ruby-localhost 1.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 232 kB
  • sloc: ruby: 579; makefile: 4
file content (23 lines) | stat: -rw-r--r-- 492 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2025, by Samuel Williams.

module Localhost
	# @namespace
	module System
		# @return [Class] The  best system class for the current platform.
		def self.current
			case RUBY_PLATFORM
			when /darwin/
				require "localhost/system/darwin"
				Darwin
			when /linux/
				require "localhost/system/linux"
				Linux
			else
				raise NotImplementedError, "Unsupported platform: #{RUBY_PLATFORM}"
			end
		end
	end
end