Class: UnpackStrategy::Dmg

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Includes:
UnpackStrategy
Defined in:
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)


155
156
157
158
# File 'unpack_strategy/dmg.rb', line 155

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:



151
152
153
# File 'unpack_strategy/dmg.rb', line 151

def self.extensions
  [".dmg"]
end