Class: UnpackStrategy::Dmg

Inherits:
Object show all
Extended by:
SystemCommand::Mixin
Includes:
UnpackStrategy
Defined in:
unpack_strategy/dmg.rb

Overview

Strategy for unpacking disk images.

Defined Under Namespace

Modules: Bom

Instance Attribute Summary

Attributes included from UnpackStrategy

#merge_xattrs, #path

Class Method Summary collapse

Methods included from SystemCommand::Mixin

system_command, system_command!

Methods included from UnpackStrategy

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

Class Method Details

.can_extract?(path) ⇒ Boolean

Returns:

  • (Boolean)


165
166
167
168
# File 'unpack_strategy/dmg.rb', line 165

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

.extensionsArray<String>

Returns:



161
162
163
# File 'unpack_strategy/dmg.rb', line 161

def self.extensions
  [".dmg"]
end