lib/app_info/dsym/debug_info.rb in app-info-3.0.0.beta3 vs lib/app_info/dsym/debug_info.rb in app-info-3.0.0.beta4

- old
+ new

@@ -10,18 +10,21 @@ def initialize(path) @path = path end + # @return [String] def object @object ||= ::File.basename(bin_path) end + # @return [::MachO::MachOFile, ::MachO::FatFile] def macho_type @macho_type ||= ::MachO.open(bin_path) end + # @return [Array<AppInfo::DSYM::MachO>] def machos @machos ||= case macho_type when ::MachO::MachOFile [MachO.new(macho_type, ::File.size(bin_path))] else @@ -35,32 +38,38 @@ end machos end end + # @return [String, nil] def release_version info.try(:[], 'CFBundleShortVersionString') end + # @return [String, nil] def build_version info.try(:[], 'CFBundleVersion') end + # @return [String, nil] def identifier info.try(:[], 'CFBundleIdentifier').sub('com.apple.xcode.dsym.', '') end alias bundle_id identifier + # @return [CFPropertyList] def info return nil unless ::File.exist?(info_path) @info ||= CFPropertyList.native_types(CFPropertyList::List.new(file: info_path).value) end + # @return [String] def info_path @info_path ||= ::File.join(path, 'Contents', 'Info.plist') end + # @return [String] 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)