Class: IESD::DMG

Inherits:
Object
  • Object
show all
Defined in:
lib/iesd/InstallESD.rb,
lib/iesd/InstallESD/BaseSystem.dmg.rb,
lib/iesd/InstallESD/InstallESD.dmg.rb,
lib/iesd/InstallESD/InstallOSX.dmg.rb

Defined Under Namespace

Classes: BaseSystem, InstallESD, InstallOSX

Class Method Summary collapse

Class Method Details

.new(url) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/iesd/InstallESD.rb', line 13

def self.new url
  i = nil
  if HDIUtil::validate url
    HDIUtil::DMG.new(url).show { |mountpoint|
      oh1 "Detecting #{url}"
      case
      when (File.exist? File.join(mountpoint, *%w{ .IABootFiles }))
        i = IESD::DMG::InstallOSX.new url
      when (File.exist? File.join(mountpoint, *%w{ BaseSystem.dmg }))
        i = IESD::DMG::InstallESD.new url
      when (File.exist? File.join(mountpoint, *%w{ System Installation }))
        i = IESD::DMG::BaseSystem.new url
      else
        raise "unknown type"
      end
      puts "Detected: #{i.class.name.split("::").last}"
    }
  end
  i
end