Class: U3d::BaseInstaller

Inherits:
Object
  • Object
show all
Defined in:
lib/u3d/installer.rb

Direct Known Subclasses

LinuxInstaller, MacInstaller, WindowsInstaller

Instance Method Summary collapse

Instance Method Details

#installed_sorted_by_versionsObject



85
86
87
88
89
# File 'lib/u3d/installer.rb', line 85

def installed_sorted_by_versions
  list = installed
  return [] if list.empty?
  list.sort { |a, b| UnityVersionComparator.new(a.version) <=> UnityVersionComparator.new(b.version) }
end

#sanitize_installsObject



72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/u3d/installer.rb', line 72

def sanitize_installs
  return unless UI.interactive? || Helper.test?
  unclean = []
  installed.each { |unity| unclean << unity unless unity.clean_install? }
  return if unclean.empty?
  UI.important("u3d can optionally standardize the existing Unity installation names and locations.")
  UI.important("Check the documentation for more information:")
  UI.important("** https://github.com/DragonBox/u3d/blob/master/README.md#default-installation-paths **")
  unclean.each { |unity| sanitize_install(unity, dry_run: true) }
  return unless UI.confirm("#{unclean.count} Unity installation(s) will be moved. Proceed??")
  unclean.each { |unity| sanitize_install(unity) }
end