Class: U3d::MacInstallation
- Inherits:
-
Installation
- Object
- Installation
- U3d::MacInstallation
- 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) ⇒ MacInstallation
constructor
A new instance of MacInstallation.
- #packages ⇒ Object
- #version ⇒ Object
Methods inherited from Installation
Constructor Details
#initialize(path: nil) ⇒ MacInstallation
Returns a new instance of MacInstallation.
52 53 54 |
# File 'lib/u3d/installer.rb', line 52 def initialize(path: nil) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
48 49 50 |
# File 'lib/u3d/installer.rb', line 48 def path @path end |
Instance Method Details
#default_log_file ⇒ Object
60 61 62 |
# File 'lib/u3d/installer.rb', line 60 def default_log_file "#{ENV['HOME']}/Library/Logs/Unity/Editor.log" end |
#exe_path ⇒ Object
64 65 66 |
# File 'lib/u3d/installer.rb', line 64 def exe_path "#{path}/Contents/MacOS/Unity" end |
#packages ⇒ Object
68 69 70 71 72 73 74 75 76 |
# File 'lib/u3d/installer.rb', line 68 def packages if Utils.parse_unity_version(version)[0].to_i <= 4 # Unity < 5 doesn't have packages return [] end fpath = File.('../PlaybackEngines', path) raise "Unity installation does not seem correct. Couldn't locate PlaybackEngines." unless Dir.exist? fpath Dir.entries(fpath).select { |e| File.directory?(File.join(fpath, e)) && !(e == '.' || e == '..') } end |
#version ⇒ Object
56 57 58 |
# File 'lib/u3d/installer.rb', line 56 def version plist['CFBundleVersion'] end |