Class: UnpackStrategy::Dmg

Inherits:
Object show all
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 UnpackStrategy

#dependencies, detect, #each_directory, #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)


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

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:



158
159
160
# File 'unpack_strategy/dmg.rb', line 158

def self.extensions
  [".dmg"]
end