cyclonedx-cocoapods 1.1.0 → 1.1.1

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: a3c7ebcac0eb8ea04cf5b1aed4da3bdbe1cadc2acb33e1bc4ebec9f52ac9bad9
4
- data.tar.gz: bdc83e96c9b4750bf2135a85b30d384ae2096e4c0591d3db2f65434506f4c220
3
+ metadata.gz: 4185f4f9ba77e7307a2f2a93ca2d96412775a6fa1a9d863b0955e0ccde099214
4
+ data.tar.gz: 4df386bef89ea9bb2bc7bfd9299a582faec48e8887f7443acd2cfb321947c0fd
5
5
  SHA512:
6
- metadata.gz: 94cdbbcb32c6d83dad78c383536dc484f08a040f5104318a3c2355b070fb915474e25027188bcaa8dfffc4222772525e4e051dfc8a1d673a08a31cd51f4d3cc2
7
- data.tar.gz: 1c0da4d2d356eb06207f889605e3c65ea0594821b7de130ebe5ce3d182917f87415fdc615d727f54f540b5a3c9c2b58d915117627b7b71c7a115045e799bc0c4
6
+ metadata.gz: 847962664a8e0d9eca4ee42d2560151de4f56fbdcb3524ff1ad208f6cac0bc5b234d879f09cccdcaddf6df81096bdb89ea26923e2195e2127334276bfb32b856
7
+ data.tar.gz: 799ca49eb4e2dd2caf9c93cd211692a364091ef8366895fe6595d109d8b455bf222c607e19b16bd410e927d7099a29a2d1dfad8b0f9d84b837705f7e7b448bb1
data/CHANGELOG.md CHANGED
@@ -4,8 +4,18 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.1.1]
8
+
9
+ ### Changed
10
+ - Better error messaging when a problem is encountered while gathering pod information ([Issue #48](https://github.com/CycloneDX/cyclonedx-cocoapods/issues/48)) [@macblazer](https://github.com/macblazer).
11
+
12
+ ### Fixed
13
+ - Including a pod that has a platform-specific dependency for an unused platform no longer causes a crash ([Issue #46](https://github.com/CycloneDX/cyclonedx-cocoapods/issues/46)) [@macblazer](https://github.com/macblazer).
14
+ - Analyzing a Podfile that has no pods defined in it no longer causes a crash [@macblazer](https://github.com/macblazer).
15
+
7
16
  ## [1.1.0]
8
17
 
18
+ ### Added
9
19
  - Can now eliminate Podfile targets that include "test" in their name ([Issue #43](https://github.com/CycloneDX/cyclonedx-cocoapods/issues/43)) [@macblazer](https://github.com/macblazer).
10
20
 
11
21
  ## [1.0.0]
@@ -33,11 +33,11 @@ module CycloneDX
33
33
 
34
34
  def attributes_for(pod:)
35
35
  specification_sets = @source_manager.search_by_name("^#{Regexp.escape(pod.root_name)}$")
36
- raise SearchError, "No pod found named #{pod.name}" if specification_sets.length == 0
37
- raise SearchError, "More than one pod found named #{pod.name}" if specification_sets.length > 1
36
+ raise SearchError, "No pod found named #{pod.name}; run 'pod repo update' and try again" if specification_sets.length == 0
37
+ raise SearchError, "More than one pod found named #{pod.name}; a pod in a private spec repo should not have the same name as a public pod" if specification_sets.length > 1
38
38
 
39
39
  paths = specification_sets[0].specification_paths_for_version(pod.version)
40
- raise SearchError, "Version #{pod.version} not found for pod #{pod.name}" if paths.length == 0
40
+ raise SearchError, "Version #{pod.version} not found for pod #{pod.name}; run 'pod repo update' and try again" if paths.length == 0
41
41
 
42
42
  ::Pod::Specification.from_file(paths[0]).attributes_hash
43
43
  end
@@ -88,7 +88,7 @@ module CycloneDX
88
88
  pods_hash = { }
89
89
 
90
90
  pods_used = lockfile.internal_data['PODS']
91
- pods_used.each { |pod|
91
+ pods_used&.each { |pod|
92
92
  if pod.is_a?(String)
93
93
  # Pods stored as String have no dependencies
94
94
  pod_name = pod.split.first
@@ -109,11 +109,13 @@ module CycloneDX
109
109
  original_number = 0
110
110
  # Loop adding pod dependencies until we are not adding any more dependencies to the result
111
111
  # This brings in all the transitive dependencies of every top level pod.
112
- # Note this also handles the edge case of having a Podfile with no pods used.
112
+ # Note this also handles two edge cases:
113
+ # 1. Having a Podfile with no pods used.
114
+ # 2. Having a pod that has a platform-specific dependency that is unused for this Podfile.
113
115
  while result.length != original_number
114
116
  original_number = result.length
115
117
  pods_used.each { |pod_name|
116
- result.push(*pods_cache[pod_name]) unless pods_cache[pod_name].empty?
118
+ result.push(*pods_cache[pod_name]) unless !pods_cache.key?(pod_name) || pods_cache[pod_name].empty?
117
119
  }
118
120
  result = result.uniq
119
121
  pods_used = result
@@ -20,7 +20,7 @@
20
20
 
21
21
  module CycloneDX
22
22
  module CocoaPods
23
- VERSION = '1.1.0'
23
+ VERSION = '1.1.1'
24
24
  DEPENDENCIES = {
25
25
  cocoapods: '~> 1.10.1',
26
26
  nokogiri: '~> 1.11.2'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cyclonedx-cocoapods
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - José González
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2022-09-13 00:00:00.000000000 Z
12
+ date: 2022-10-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cocoapods