lib/run_loop/lipo.rb in run_loop-1.3.1 vs lib/run_loop/lipo.rb in run_loop-1.3.2

- old
+ new

@@ -69,11 +69,11 @@ instruction_set = device.instruction_set unless arches.include?(instruction_set) raise RunLoop::IncompatibleArchitecture, ['Binary at:', binary_path, - "does not contain a compatible architecture for target device.", + 'does not contain a compatible architecture for target device.', "Expected '#{instruction_set}' but found #{arches}."].join("\n") end end end @@ -83,13 +83,13 @@ def info execute_lipo("-info \"#{binary_path}\"") do |stdout, stderr, wait_thr| output = stdout.read.strip begin output.split(':')[-1].strip.split - rescue Exception => e + rescue StandardError => e msg = ['Expected to be able to parse the output of lipo.', - "cmd: 'lipo -info #{escaped_binary_path}'", + "cmd: 'lipo -info \"#{binary_path}\"'", "stdout: '#{output}'", "stderr: '#{stderr.read.strip}'", "exit code: '#{wait_thr.value}'", e.message] raise msg.join("\n") @@ -100,9 +100,10 @@ private # Caller is responsible for correctly escaping arguments. # For example, the caller must proper quote `"` paths to avoid errors # when dealing with paths that contain spaces. + # @todo #execute_lipo should take an [] of arguments def execute_lipo(argument) command = "xcrun lipo #{argument}" Open3.popen3(command) do |_, stdout, stderr, wait_thr| yield stdout, stderr, wait_thr end