Module: Localhost::System

Defined in:
lib/localhost/system.rb,
lib/localhost/system/linux.rb,
lib/localhost/system/darwin.rb

Defined Under Namespace

Modules: Darwin, Linux

Class Method Summary collapse

Class Method Details

.currentClass

Returns The best system class for the current platform.

Returns:

  • (Class)

    The best system class for the current platform.



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/localhost/system.rb', line 10

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