Class: UnpackStrategy::MicrosoftOfficeXml

Inherits:
Uncompressed show all
Defined in:
brew/Library/Homebrew/unpack_strategy/microsoft_office_xml.rb

Instance Attribute Summary

Attributes included from UnpackStrategy

#merge_xattrs, #path

Class Method Summary collapse

Methods inherited from Uncompressed

#extract_nestedly

Methods included from UnpackStrategy

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

Class Method Details

.can_extract?(path) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
20
21
22
23
# File 'brew/Library/Homebrew/unpack_strategy/microsoft_office_xml.rb', line 17

def self.can_extract?(path)
  return false unless Zip.can_extract?(path)

  # Check further if the ZIP is a Microsoft Office XML document.
  path.magic_number.match?(/\APK\003\004/n) &&
    path.magic_number.match?(%r{\A.{30}(\[Content_Types\]\.xml|_rels/\.rels)}n)
end

.extensionsObject



9
10
11
12
13
14
15
# File 'brew/Library/Homebrew/unpack_strategy/microsoft_office_xml.rb', line 9

def self.extensions
  [
    ".doc", ".docx",
    ".ppt", ".pptx",
    ".xls", ".xlsx"
  ]
end