Class: U3d::LinuxInstallation
- Inherits:
-
Installation
- Object
- Installation
- U3d::LinuxInstallation
- Defined in:
- lib/u3d/installer.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #default_log_file ⇒ Object
- #exe_path ⇒ Object
-
#initialize(path: nil) ⇒ LinuxInstallation
constructor
A new instance of LinuxInstallation.
- #packages ⇒ Object
- #version ⇒ Object
Methods inherited from Installation
Constructor Details
#initialize(path: nil) ⇒ LinuxInstallation
Returns a new instance of LinuxInstallation.
88 89 90 |
# File 'lib/u3d/installer.rb', line 88 def initialize(path: nil) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
86 87 88 |
# File 'lib/u3d/installer.rb', line 86 def path @path end |
Instance Method Details
#default_log_file ⇒ Object
105 106 107 |
# File 'lib/u3d/installer.rb', line 105 def default_log_file "#{ENV['HOME']}/.config/unity3d/Editor.log" end |
#exe_path ⇒ Object
109 110 111 |
# File 'lib/u3d/installer.rb', line 109 def exe_path "#{path}/Unity" end |
#packages ⇒ Object
113 114 115 |
# File 'lib/u3d/installer.rb', line 113 def packages false end |
#version ⇒ Object
92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/u3d/installer.rb', line 92 def version # I don't find an easy way to extract the version on Linux require 'rexml/document' fpath = "#{path}/Data/PlaybackEngines/LinuxStandaloneSupport/ivy.xml" raise "Couldn't find file #{fpath}" unless File.exist? fpath doc = REXML::Document.new(File.read(fpath)) version = REXML::XPath.first(doc, 'ivy-module/info/@e:unityVersion').value if m = version.match(/^(.*)x(.*)Linux$/) version = "#{m[1]}#{m[2]}" end version end |