Class: Nauvisian::Platform
- Inherits:
-
Object
- Object
- Nauvisian::Platform
show all
- Defined in:
- lib/nauvisian/platform.rb
Defined Under Namespace
Classes: Linux, MacOS, Windows
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/nauvisian/platform.rb', line 8
def self.platform
host_os = RbConfig::CONFIG["host_os"]
case host_os
when /\bdarwin\d*\b/
MacOS.new
when /\blinux\z/
Linux.new
when /\b(?:cygwin|mswin|mingw|bccwin|wince|emx)\b/
Windows.new
else
raise UnsupportedPlatform, host_os
end
end
|
Instance Method Details
#application_directory ⇒ Object
33
34
35
|
# File 'lib/nauvisian/platform.rb', line 33
def application_directory
APPLICATON_DIRECTORIES.find(&:directory?)
end
|
#home_directory ⇒ Object
37
38
39
|
# File 'lib/nauvisian/platform.rb', line 37
def home_directory
Pathname("~").expand_path.freeze
end
|
#mod_directory ⇒ Object
22
|
# File 'lib/nauvisian/platform.rb', line 22
def mod_directory = user_data_directory / "mods"
|
#save_directory ⇒ Object
24
|
# File 'lib/nauvisian/platform.rb', line 24
def save_directory = user_data_directory / "saves"
|
#script_output_directory ⇒ Object
26
|
# File 'lib/nauvisian/platform.rb', line 26
def script_output_directory = user_data_directory / "script-output"
|
#user_data_directory ⇒ Object
Returns the directory which holds user data
29
30
31
|
# File 'lib/nauvisian/platform.rb', line 29
def user_data_directory
raise NotImplementedError
end
|