Sha256: e4c76f130c880e61656eabaf60841fea9c3cc0aede142c853a2f9bf9a3c8f262
Contents?: true
Size: 1.2 KB
Versions: 2
Compression:
Stored size: 1.2 KB
Contents
module RunLoop # @!visibility private # # A class for interacting with otool class Otool # @!visibility private attr_reader :path # @!visibility private def initialize(path) @path = path if !Otool.valid_path?(path) raise ArgumentError, %Q{File: #{path} must exist and not be a directory. } end end # @!visibility private def to_s "#<OTOOL: #{path}>" end # @!visibility private def inspect to_s end # @!visibility private def executable? !arch_info[/is not an object file/, 0] end private # @!visibility private def arch_info args = ["otool", "-hv", "-arch", "all", path] opts = { :log_cmd => true } hash = xcrun.exec(args, opts) if hash[:exit_status] != 0 raise RuntimeError, %Q{Could not get arch info from file: #{path} #{args.join(" ")} exited #{hash[:exit_status]} with the following output: #{hash[:out]} } end @arch_info = hash[:out] end # @!visibility private def self.valid_path?(path) File.exist?(path) && !File.directory?(path) end # @!visibility private def xcrun RunLoop::Xcrun.new end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
run_loop-2.0.7 | lib/run_loop/otool.rb |
run_loop-2.0.6 | lib/run_loop/otool.rb |