class U3d::MacInstallation

Public Instance Methods

build_number() click to toggle source
# File lib/u3d/installation.rb, line 163
def build_number
  plist['UnityBuildNumber']
end
clean_install?() click to toggle source
# File lib/u3d/installation.rb, line 209
def clean_install?
  do_not_move? || !(root_path =~ UNITY_DIR_CHECK).nil?
end
default_log_file() click to toggle source
# File lib/u3d/installation.rb, line 167
def default_log_file
  "#{ENV['HOME']}/Library/Logs/Unity/Editor.log"
end
exe_path() click to toggle source
# File lib/u3d/installation.rb, line 171
def exe_path
  "#{root_path}/Unity.app/Contents/MacOS/Unity"
end
module_name_pattern(module_name) click to toggle source
# File lib/u3d/installation.rb, line 196
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
packages() click to toggle source
# File lib/u3d/installation.rb, line 181
def packages
  pack = []
  IvyPlaybackEngineUtils.list_module_configs(root_path).each do |mpath|
    pack << IvyPlaybackEngineUtils.module_name(mpath)
  end
  ModulePlaybackEngineUtils.list_module_configs(root_path).each do |mpath|
    pack << ModulePlaybackEngineUtils.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
path() click to toggle source
# File lib/u3d/installation.rb, line 175
def path
  UI.deprecated("path is deprecated. Use root_path instead")
  return @path if @path
  "#{@root_path}/Unity.app"
end
version() click to toggle source
# File lib/u3d/installation.rb, line 159
def version
  plist['CFBundleVersion']
end

Private Instance Methods

plist() click to toggle source
# File lib/u3d/installation.rb, line 215
def plist
  @plist ||=
    begin
      fpath = "#{root_path}/Unity.app/Contents/Info.plist"
      raise "#{fpath} doesn't exist" unless File.exist? fpath
      Plist.parse_xml(fpath)
    end
end