Class: U3d::MacInstallation

Inherits:
Installation show all
Defined in:
lib/u3d/installation.rb

Constant Summary

Constants inherited from Installation

Installation::NOT_PLAYBACKENGINE_PACKAGES, Installation::PACKAGE_ALIASES

Instance Attribute Summary

Attributes inherited from Installation

#root_path

Instance Method Summary collapse

Methods inherited from Installation

create, #do_not_move!, #do_not_move?, #initialize, #package_installed?

Constructor Details

This class inherits a constructor from U3d::Installation

Instance Method Details

#build_numberObject



137
138
139
# File 'lib/u3d/installation.rb', line 137

def build_number
  plist['UnityBuildNumber']
end

#clean_install?Boolean

Returns:

  • (Boolean)


179
180
181
# File 'lib/u3d/installation.rb', line 179

def clean_install?
  do_not_move? || !(root_path =~ UNITY_DIR_CHECK).nil?
end

#default_log_fileObject



141
142
143
# File 'lib/u3d/installation.rb', line 141

def default_log_file
  "#{ENV['HOME']}/Library/Logs/Unity/Editor.log"
end

#exe_pathObject



145
146
147
# File 'lib/u3d/installation.rb', line 145

def exe_path
  "#{root_path}/Unity.app/Contents/MacOS/Unity"
end

#module_name_pattern(module_name) ⇒ Object



166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/u3d/installation.rb', line 166

def module_name_pattern(module_name)
  case module_name
  when 'Documentation'
    return "#{root_path}/Documentation/"
  when 'StandardAssets'
    return "#{root_path}/Standard Assets/"
  when 'MonoDevelop'
    return "#{root_path}/MonoDevelop.app/"
  else
    UI.crash! "No pattern is known for #{module_name} on Mac"
  end
end

#packagesObject



155
156
157
158
159
160
161
162
163
164
# File 'lib/u3d/installation.rb', line 155

def packages
  pack = []
  PlaybackEngineUtils.list_module_configs(root_path).each do |mpath|
    pack << PlaybackEngineUtils.module_name(mpath)
  end
  NOT_PLAYBACKENGINE_PACKAGES.each do |module_name|
    pack << module_name unless Dir[module_name_pattern(module_name)].empty?
  end
  pack
end

#pathObject



149
150
151
152
153
# File 'lib/u3d/installation.rb', line 149

def path
  UI.deprecated("path is deprecated. Use root_path instead")
  return @path if @path
  "#{@root_path}/Unity.app"
end

#versionObject



133
134
135
# File 'lib/u3d/installation.rb', line 133

def version
  plist['CFBundleVersion']
end