Class: AppInfo::DSYM
- Includes:
- Helper::Archive
- Defined in:
- lib/app_info/dsym.rb,
lib/app_info/dsym/macho.rb,
lib/app_info/dsym/debug_info.rb
Overview
DSYM parser
Defined Under Namespace
Instance Attribute Summary
Attributes inherited from File
Instance Method Summary collapse
- #clear! ⇒ Object
-
#contents ⇒ String
Contents path of dsym.
- #each_file(&block) ⇒ nil (also: #each_objects)
-
#files ⇒ Array<DebugInfo>
(also: #objects)
Dsym_files files by alphabetical order.
- #manufacturer ⇒ Symbol
Methods included from Helper::Archive
Methods inherited from File
#device, #format, #initialize, #not_implemented_error!, #platform, #size
Constructor Details
This class inherits a constructor from AppInfo::File
Instance Method Details
#clear! ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/app_info/dsym.rb', line 29 def clear! return unless @contents FileUtils.rm_rf(@contents) @contents = nil @files = nil end |
#contents ⇒ String
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/app_info/dsym.rb', line 39 def contents @contents ||= lambda { return @file if ::File.directory?(@file) dsym_filenames = [] unarchive(@file, prefix: 'dsym') do |base_path, zip_file| zip_file.each do |entry| file_path = entry.name next unless file_path.downcase.include?('.dsym/contents/') next if ::File.basename(file_path).start_with?('.') dsym_filename = file_path.split('/').select { |f| f.downcase.end_with?('.dsym') }.last dsym_filenames << dsym_filename unless dsym_filenames.include?(dsym_filename) unless file_path.start_with?(dsym_filename) file_path = file_path.split('/')[1..-1].join('/') end dest_path = ::File.join(base_path, file_path) FileUtils.mkdir_p(::File.dirname(dest_path)) entry.extract(dest_path) unless ::File.exist?(dest_path) end end }.call end |
#each_file(&block) ⇒ nil Also known as: each_objects
16 17 18 |
# File 'lib/app_info/dsym.rb', line 16 def each_file(&block) files.each { |file| block.call(file) } end |
#files ⇒ Array<DebugInfo> Also known as: objects
22 23 24 25 26 |
# File 'lib/app_info/dsym.rb', line 22 def files @files ||= Dir.children(contents).sort.each_with_object([]) do |file, obj| obj << DebugInfo.new(::File.join(contents, file)) end end |
#manufacturer ⇒ Symbol
11 12 13 |
# File 'lib/app_info/dsym.rb', line 11 def manufacturer Manufacturer::APPLE end |