Class: U3d::LinuxInstallation

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



291
292
293
# File 'lib/u3d/installation.rb', line 291

def build_number
  @build_number ||= LinuxInstallationHelper.new.find_build_number(root_path)
end

#clean_install?Boolean

Returns:

  • (Boolean)


337
338
339
# File 'lib/u3d/installation.rb', line 337

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

#default_log_fileObject



295
296
297
# File 'lib/u3d/installation.rb', line 295

def default_log_file
  "#{ENV['HOME']}/.config/unity3d/Editor.log"
end

#exe_pathObject



299
300
301
# File 'lib/u3d/installation.rb', line 299

def exe_path
  "#{root_path}/Editor/Unity"
end

#module_name_pattern(module_name) ⇒ Object



323
324
325
326
327
328
329
330
331
332
333
334
335
# File 'lib/u3d/installation.rb', line 323

def module_name_pattern(module_name)
  # FIXME: we are not yet sure where these modules will end up yet
  case module_name
  when 'Documentation'
    return "#{root_path}/Editor/Data/Documentation/"
  when 'StandardAssets'
    return "#{root_path}/Editor/Standard Assets/"
  when 'MonoDevelop'
    return "#{root_path}/MonoDevelop/"
  else
    UI.crash! "No pattern is known for #{module_name} on Linux"
  end
end

#packagesObject



308
309
310
311
312
313
314
315
316
317
318
319
320
321
# File 'lib/u3d/installation.rb', line 308

def packages
  path = "#{root_path}/Editor/Data/"
  pack = []
  IvyPlaybackEngineUtils.list_module_configs(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

#pathObject



303
304
305
306
# File 'lib/u3d/installation.rb', line 303

def path
  UI.deprecated("path is deprecated. Use root_path instead")
  @root_path || @path
end

#versionObject



286
287
288
289
# File 'lib/u3d/installation.rb', line 286

def version
  path = "#{root_path}/Editor/Data/Resources/unity_builtin_extra"
  InstallationUtils.read_version_from_unity_builtin_extra(path)
end