Class: Hbc::Container::Executable

Inherits:
Naked
  • Object
show all
Defined in:
Library/Homebrew/cask/lib/hbc/container/executable.rb

Class Method Summary collapse

Methods inherited from Naked

#extract, #target_file

Methods inherited from Base

#extract_nested_container, #extract_nested_inside, #initialize, #verbose?

Constructor Details

This class inherits a constructor from Hbc::Container::Base

Class Method Details

.me?(criteria) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
11
12
13
14
15
# File 'Library/Homebrew/cask/lib/hbc/container/executable.rb', line 7

def self.me?(criteria)
  return true if criteria.magic_number(/^#!\s*\S+/)

  begin
    criteria.path.file? && MachO.open(criteria.path).header.executable?
  rescue MachO::MagicError
    false
  end
end