Class: UnpackStrategy::Dmg

Inherits:
Object
  • Object
show all
Includes:
UnpackStrategy
Defined in:
Library/Homebrew/unpack_strategy/dmg.rb

Overview

Strategy for unpacking disk images.

Instance Attribute Summary

Attributes included from UnpackStrategy

#merge_xattrs, #path

Class Method Summary collapse

Methods included from UnpackStrategy

#dependencies, detect, #extract, #extract_nestedly, from_extension, from_magic, from_type, #initialize

Methods included from SystemCommand::Mixin

#system_command, #system_command!

Class Method Details

.can_extract?(path) ⇒ Boolean

Returns:

  • (Boolean)

112
113
114
115
# File 'Library/Homebrew/unpack_strategy/dmg.rb', line 112

def self.can_extract?(path)
  stdout, _, status = system_command("hdiutil", args: ["imageinfo", "-format", path], print_stderr: false)
  status.success? && !stdout.empty?
end

.extensionsObject


108
109
110
# File 'Library/Homebrew/unpack_strategy/dmg.rb', line 108

def self.extensions
  [".dmg"]
end