Class: DsymFile

Inherits:
Object
  • Object
show all
Defined in:
lib/symsym.rb

Overview

DsymFile - wrapper around a .dSYM bundle

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ DsymFile

Initializes a DsymFile with a path to a dSYM Bundle

Extracts CFBundleIdentifier, CFBundleVersion and CFBundleShortVersionString from the Info.plist file inside the bundle



13
14
15
16
17
18
19
20
# File 'lib/symsym.rb', line 13

def initialize(filename)
  @info_plist = OSX::NSDictionary.dictionaryWithContentsOfFile(File.join(filename, 'Contents/Info.plist'))
  return unless @info_plist
  @identifier         = @info_plist['CFBundleIdentifier'].to_s
  @version            = @info_plist['CFBundleVersion'].to_s
  @shortversionstring = @info_plist['CFBundleShortVersionString'].to_s
  @filename = filename
end

Instance Attribute Details

#identifierObject (readonly)

Returns the value of attribute identifier.



8
9
10
# File 'lib/symsym.rb', line 8

def identifier
  @identifier
end

#shortversionstringObject (readonly)

Returns the value of attribute shortversionstring.



8
9
10
# File 'lib/symsym.rb', line 8

def shortversionstring
  @shortversionstring
end

#versionObject (readonly)

Returns the value of attribute version.



8
9
10
# File 'lib/symsym.rb', line 8

def version
  @version
end

Instance Method Details

#matches_report?(report) ⇒ Boolean

Matches Report?

Checks if the Bundle Identifier, Bundle Version and Bundle Short Version String of a given Crashreport matches to this dSYM Bundle

Returns:

  • (Boolean)


25
26
27
28
# File 'lib/symsym.rb', line 25

def matches_report?(report)
  false
  true if @identifier =~ /#{report.identifier}/ && @version == report.version && @shortversionstring == report.shortversion
end

#to_sObject

return the filename



31
32
33
# File 'lib/symsym.rb', line 31

def to_s
  @filename
end