Method: RunLoop::Lipo#info

Defined in:
lib/run_loop/lipo.rb

#infoArray<String>

Returns a list of architecture in the binary.

Returns:

  • (Array<String>)

    A list of architecture.

Raises:

  • (RuntimeError)

    If the output of lipo cannot be parsed.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/run_loop/lipo.rb', line 93

def info
  execute_lipo("-info \"#{binary_path}\"") do |stdout, stderr, wait_thr|
    output = stdout.read.strip
    begin
      output.split(':')[-1].strip.split
    rescue StandardError => e
      msg = ['Expected to be able to parse the output of lipo.',
             "cmd:    'lipo -info \"#{binary_path}\"'",
             "stdout: '#{output}'",
             "stderr: '#{stderr.read.strip}'",
             "exit code: '#{wait_thr.value}'",
             e.message]
      raise msg.join("\n")
    end
  end
end