Module: MachOShim

Extended by:
Forwardable
Defined in:
brew/Library/Homebrew/os/mac/mach.rb

Instance Method Summary collapse

Instance Method Details

#archObject



69
70
71
72
73
74
75
# File 'brew/Library/Homebrew/os/mac/mach.rb', line 69

def arch
  case archs.length
  when 0 then :dunno
  when 1 then archs.first
  else :universal
  end
end

#archsObject



65
66
67
# File 'brew/Library/Homebrew/os/mac/mach.rb', line 65

def archs
  mach_data.map { |m| m.fetch :arch }.extend(ArchitectureListExtension)
end

#dynamically_linked_libraries(except: :none) ⇒ Object



59
60
61
62
63
# File 'brew/Library/Homebrew/os/mac/mach.rb', line 59

def dynamically_linked_libraries(except: :none)
  lcs = macho.dylib_load_commands.reject { |lc| lc.type == except }

  lcs.map(&:name).map(&:to_s).uniq
end

#i386?Boolean

Returns:

  • (Boolean)


81
82
83
# File 'brew/Library/Homebrew/os/mac/mach.rb', line 81

def i386?
  arch == :i386
end

#ppc64?Boolean

Returns:

  • (Boolean)


93
94
95
# File 'brew/Library/Homebrew/os/mac/mach.rb', line 93

def ppc64?
  arch == :ppc64
end

#ppc7400?Boolean

Returns:

  • (Boolean)


89
90
91
# File 'brew/Library/Homebrew/os/mac/mach.rb', line 89

def ppc7400?
  arch == :ppc7400
end

#universal?Boolean

Returns:

  • (Boolean)


77
78
79
# File 'brew/Library/Homebrew/os/mac/mach.rb', line 77

def universal?
  arch == :universal
end

#x86_64?Boolean

Returns:

  • (Boolean)


85
86
87
# File 'brew/Library/Homebrew/os/mac/mach.rb', line 85

def x86_64?
  arch == :x86_64
end