slather 2.8.3 → 2.8.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56a719230361994fdcfc33ef801d05bf5fa68714efdaa477d1aed4fdad05ee07
4
- data.tar.gz: 54bb876601b8aa9e0030e8e29b3e75663d5a3c38855b3f2b56db0b23b1f4377d
3
+ metadata.gz: 5b2390d1df8d9295fc1239bcaba55dcc176a8d31a755fab5e4e1185ee27bc1a7
4
+ data.tar.gz: 3f85d92eaf943f25c799b70798b7f86f2196e51e44470ba84ea4adc02b919d52
5
5
  SHA512:
6
- metadata.gz: 91f45c65454ba75daf6b34529287c7cda4978e60b84ba37cf2e758977382ecc1aa8b13f5e81b6d5616778d2339f2422df4b6a85f539f3922dcd40088d562b9e6
7
- data.tar.gz: 50c23e7d3d92d380c0ad385e21ee04fccc9f2b012c4db1657758fc428bbbc6c389e03ec40c2df420f6f493819b2ea98b754d74a678a484d8338f8c7c975934a4
6
+ metadata.gz: d47d53bd5a72e09598140ff646dcd7cde3581387433edbd4d30d49ff468956f446d85fe9a4800092b54ab133b95ac8738c79168836f1562b7c394a9696c71bf0
7
+ data.tar.gz: 85da0669f94911b362e2d5dd23789a540762e2c3b40cd880ac8b274aa253249bb71525735d5ec72289ecb8926755a7b4067d2b7803f42e9a7a2ec3d38f4fc439
data/.gitignore CHANGED
@@ -59,4 +59,8 @@ DerivedData
59
59
 
60
60
  # Test output
61
61
  report.llcov
62
- report.json
62
+ report.json
63
+
64
+ # VSCode
65
+ .vscode
66
+ .rdbgrc*
data/CHANGELOG.md CHANGED
@@ -1,6 +1,16 @@
1
1
  # CHANGELOG
2
2
 
3
- ## v2.8.3
3
+ ## v2.8.4
4
+
5
+ * Don't crash when 0% coverage is causing empty JSON
6
+ [jarrodlombardo-EventBase](https://github.com/jarrodlombardo-EventBase)
7
+ [#570](https://github.com/SlatherOrg/slather/pull/570)
8
+
9
+ * Xcode 16 compatibility (as of beta 5)
10
+ [ksuther](https://github.com/ksuther)
11
+ [#568](https://github.com/SlatherOrg/slather/pull/568)
12
+
13
+ ## v2.8.3
4
14
 
5
15
  * Fix coverage_file.source_file_pathname
6
16
  [alfredofernandes](https://github.com/alfredofernandes)
@@ -132,21 +132,26 @@ module Slather
132
132
 
133
133
  def pathnames_per_binary(binary_path)
134
134
  coverage_json_string = llvm_cov_export_output(binary_path)
135
- coverage_json = JSON.parse(coverage_json_string)
136
- coverage_json["data"].reduce([]) do |result, chunk|
137
- result.concat(chunk["files"].map do |file|
138
- filename = file["filename"]
139
- path = Pathname(filename)
140
- # Don't crash if the file doesn't exist on disk.
141
- # This may happen for autogenerated files that have been deleted.
142
- filename = path.exist? ? path.realpath : filename
143
- {"filename" => filename, "segments" => file["segments"]}
144
- end)
135
+ if coverage_json_string.strip != ""
136
+ # JSON.parse will crash on an empty string, so just skip everything if the string is empty.
137
+ coverage_json = JSON.parse(coverage_json_string)
138
+ coverage_json["data"].reduce([]) do |result, chunk|
139
+ result.concat(chunk["files"].map do |file|
140
+ filename = file["filename"]
141
+ path = Pathname(filename)
142
+ # Don't crash if the file doesn't exist on disk.
143
+ # This may happen for autogenerated files that have been deleted.
144
+ filename = path.exist? ? path.realpath : filename
145
+ {"filename" => filename, "segments" => file["segments"]}
146
+ end)
147
+ end
145
148
  end
146
149
  end
147
150
  private :pathnames_per_binary
148
151
 
149
152
  def create_coverage_files_for_binary(binary_path, pathnames_per_binary)
153
+ return [] unless pathnames_per_binary != nil
154
+
150
155
  coverage_files = []
151
156
 
152
157
  begin
@@ -482,7 +487,16 @@ module Slather
482
487
  def find_binary_file_in_bundle(bundle_file)
483
488
  if File.directory? bundle_file
484
489
  bundle_file_noext = File.basename(bundle_file, File.extname(bundle_file))
485
- Dir["#{bundle_file}/**/#{bundle_file_noext}"].first
490
+
491
+ # Search for .debug.dylib binaries
492
+ # See https://developer.apple.com/documentation/xcode/build-settings-reference#Enable-Debug-Dylib-Support for details
493
+ debug_dylib_matches = Dir["#{bundle_file}/**/#{bundle_file_noext}.debug.dylib"]
494
+
495
+ if debug_dylib_matches.length() > 0
496
+ debug_dylib_matches.first
497
+ else
498
+ Dir["#{bundle_file}/**/#{bundle_file_noext}"].first
499
+ end
486
500
  else
487
501
  bundle_file
488
502
  end
@@ -1,3 +1,3 @@
1
1
  module Slather
2
- VERSION = '2.8.3' unless defined?(Slather::VERSION)
2
+ VERSION = '2.8.4' unless defined?(Slather::VERSION)
3
3
  end
data/slather.gemspec CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.add_development_dependency 'equivalent-xml', '~> 0.6'
29
29
 
30
30
  spec.add_dependency 'clamp', '~> 1.3'
31
- spec.add_dependency 'xcodeproj', '~> 1.21'
31
+ spec.add_dependency 'xcodeproj', '~> 1.25'
32
32
  spec.add_dependency 'nokogiri', '>= 1.14.3'
33
33
  spec.add_dependency 'CFPropertyList', '>= 2.2', '< 4'
34
34
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slather
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.3
4
+ version: 2.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Larsen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-29 00:00:00.000000000 Z
11
+ date: 2024-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '1.21'
159
+ version: '1.25'
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '1.21'
166
+ version: '1.25'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: nokogiri
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -341,7 +341,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
341
341
  - !ruby/object:Gem::Version
342
342
  version: '0'
343
343
  requirements: []
344
- rubygems_version: 3.5.4
344
+ rubygems_version: 3.5.18
345
345
  signing_key:
346
346
  specification_version: 4
347
347
  summary: Test coverage reports for Xcode projects