Class: DsymFile
- Inherits:
-
Object
- Object
- DsymFile
- Defined in:
- lib/symsym.rb
Overview
DsymFile - wrapper around a .dSYM bundle
Instance Attribute Summary collapse
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#shortversionstring ⇒ Object
readonly
Returns the value of attribute shortversionstring.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(filename) ⇒ DsymFile
constructor
Initializes a DsymFile with a path to a dSYM Bundle.
-
#matches_report?(report) ⇒ Boolean
Matches Report?.
-
#to_s ⇒ Object
return the filename.
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
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
8 9 10 |
# File 'lib/symsym.rb', line 8 def identifier @identifier end |
#shortversionstring ⇒ Object (readonly)
Returns the value of attribute shortversionstring.
8 9 10 |
# File 'lib/symsym.rb', line 8 def shortversionstring @shortversionstring end |
#version ⇒ Object (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
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_s ⇒ Object
return the filename
31 32 33 |
# File 'lib/symsym.rb', line 31 def to_s @filename end |