Class: AppInfo::DSYM::DebugInfo
- Inherits:
-
Object
- Object
- AppInfo::DSYM::DebugInfo
- Defined in:
- lib/app_info/dsym/debug_info.rb
Overview
DSYM Debug Information Format Struct
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #bin_path ⇒ String
- #build_version ⇒ String?
- #identifier ⇒ String? (also: #bundle_id)
- #info ⇒ CFPropertyList
- #info_path ⇒ String
-
#initialize(path) ⇒ DebugInfo
constructor
A new instance of DebugInfo.
- #macho_type ⇒ ::MachO::MachOFile, ::MachO::FatFile
- #machos ⇒ Array<AppInfo::DSYM::MachO>
- #object ⇒ String
- #release_version ⇒ String?
Constructor Details
#initialize(path) ⇒ DebugInfo
Returns a new instance of DebugInfo.
11 12 13 |
# File 'lib/app_info/dsym/debug_info.rb', line 11 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
9 10 11 |
# File 'lib/app_info/dsym/debug_info.rb', line 9 def path @path end |
Instance Method Details
#bin_path ⇒ String
72 73 74 75 76 77 78 |
# File 'lib/app_info/dsym/debug_info.rb', line 72 def bin_path @bin_path ||= lambda { dwarf_path = ::File.join(path, 'Contents', 'Resources', 'DWARF') name = Dir.children(dwarf_path)[0] ::File.join(dwarf_path, name) }.call end |
#build_version ⇒ String?
49 50 51 |
# File 'lib/app_info/dsym/debug_info.rb', line 49 def build_version info.try(:[], 'CFBundleVersion') end |
#identifier ⇒ String? Also known as: bundle_id
54 55 56 |
# File 'lib/app_info/dsym/debug_info.rb', line 54 def identifier info.try(:[], 'CFBundleIdentifier').sub('com.apple.xcode.dsym.', '') end |
#info ⇒ CFPropertyList
60 61 62 63 64 |
# File 'lib/app_info/dsym/debug_info.rb', line 60 def info return nil unless ::File.exist?(info_path) @info ||= CFPropertyList.native_types(CFPropertyList::List.new(file: info_path).value) end |
#info_path ⇒ String
67 68 69 |
# File 'lib/app_info/dsym/debug_info.rb', line 67 def info_path @info_path ||= ::File.join(path, 'Contents', 'Info.plist') end |
#macho_type ⇒ ::MachO::MachOFile, ::MachO::FatFile
21 22 23 |
# File 'lib/app_info/dsym/debug_info.rb', line 21 def macho_type @macho_type ||= ::MachO.open(bin_path) end |
#machos ⇒ Array<AppInfo::DSYM::MachO>
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/app_info/dsym/debug_info.rb', line 26 def machos @machos ||= case macho_type when ::MachO::MachOFile [MachO.new(macho_type, ::File.size(bin_path))] else size = macho_type.fat_archs.each_with_object([]) do |arch, obj| obj << arch.size end machos = [] macho_type.machos.each_with_index do |file, i| machos << MachO.new(file, size[i]) end machos end end |
#object ⇒ String
16 17 18 |
# File 'lib/app_info/dsym/debug_info.rb', line 16 def object @object ||= ::File.basename(bin_path) end |
#release_version ⇒ String?
44 45 46 |
# File 'lib/app_info/dsym/debug_info.rb', line 44 def release_version info.try(:[], 'CFBundleShortVersionString') end |