cocoapods-privacy 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 169d976a4180a55f5ad139c4db9c1693eeccf2147077d92aa638eaf65ca4314f
4
- data.tar.gz: 63cc1f7128d7117ecf373408c1309fa21917b3c06588b59b000b10de6eeb65c2
3
+ metadata.gz: b1138888b85b8d2e4eb857fc7bb3d86f305f8a414b79702a9e898da0c351b7f8
4
+ data.tar.gz: e47d7800f08af2b3464f5dcf7cfb77c8e46961d2198acb4e12390df3eeff6df0
5
5
  SHA512:
6
- metadata.gz: 6cff9908e2198aa3068029f9e1b40603bfa279d73933f7099763cd91be76128db9e3b000cdf9182dfe84f11ced41954c63e0524041b8c8e681138fb29416df8b
7
- data.tar.gz: 564d4fa4e65c300b9009e54e54747728c5cc0f57b25c8e566a9ed0a5323d98044dd53efe22fd1c307fc9ebf38f309f028cdc72f18052123990c4740d0775dd35
6
+ metadata.gz: e3d5745b2c7c7eaa6cdffe1e9f11a6d6720a8b2fd56d6a7195b6176a99467f2462e5f3e4233d695148ebe38ef07f74ab92525f318bf930bf9dc806f0ba4dfedb
7
+ data.tar.gz: 0caa4e0cfe57beadfdbf979bfe9712997e5b9d5193216204ee5eef51292d8d1638522d5f2bb892e978007fda675918cc0aff28688bc26a72fe0bfa55640904ee
@@ -1,3 +1,3 @@
1
1
  module CocoapodsPrivacy
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -8,6 +8,7 @@ require 'cocoapods-privacy/command'
8
8
  # 3、检索到的内容转换成隐私协议格式写入 隐私清单文件 PrivacyInfo.xcprivacy
9
9
  ##
10
10
  module PrivacyHunter
11
+
11
12
  KTypes = "NSPrivacyAccessedAPITypes"
12
13
  KType = "NSPrivacyAccessedAPIType"
13
14
  KReasons = "NSPrivacyAccessedAPITypeReasons"
@@ -103,12 +104,12 @@ module PrivacyHunter
103
104
  def self.fetch_template_plist_file
104
105
 
105
106
  unless File.exist?(PrivacyUtils.cache_config_file)
106
- raise Informative, "无配置文件,run `pod privacy config config_file' 进行配置"
107
+ raise Pod::Informative, "无配置文件,run `pod privacy config config_file' 进行配置"
107
108
  end
108
109
 
109
110
  template_url = Privacy::Config.instance.api_template_url
110
111
  unless template_url && !template_url.empty?
111
- raise Informative, "配置文件中无 `api.template.url` 配置,请补全后再更新配置 `pod privacy config config_file` "
112
+ raise Pod::Informative, "配置文件中无 `api.template.url` 配置,请补全后再更新配置 `pod privacy config config_file` "
112
113
  end
113
114
 
114
115
  # 目标文件路径
@@ -33,7 +33,7 @@ class BBSpec
33
33
 
34
34
  def initialize(name,alias_name,full_name)
35
35
  @rows = []
36
- @privacy_sources = []
36
+ @privacy_sources = nil
37
37
  @name = name
38
38
  @alias_name = alias_name
39
39
  @full_name = full_name
@@ -53,7 +53,7 @@ class BBSpec
53
53
  spec = eval("Pod::Spec.new do |s|; s.source_files = #{line.value}; end;")
54
54
  if spec && !spec.attributes_hash['source_files'].nil?
55
55
  source_files_value = spec.attributes_hash['source_files']
56
- if source_files_value.is_a?(String)
56
+ if source_files_value.is_a?(String) && !source_files_value.empty?
57
57
  source_files_array = [source_files_value]
58
58
  elsif source_files_value.is_a?(Array)
59
59
  # 如果已经是数组,直接使用
@@ -76,14 +76,14 @@ class BBSpec
76
76
 
77
77
  # 对应Spec新增隐私文件
78
78
  def create_privacy_file_if_need(podspec_file_path)
79
- if !@privacy_sources.empty?
79
+ if @privacy_sources
80
80
  PrivacyUtils.create_privacy_if_empty(File.join(File.dirname(podspec_file_path), @privacy_file))
81
81
  end
82
82
  end
83
83
 
84
84
  # 把新增的隐私文件 映射给 podspec
85
85
  def modify_privacy_resource_bundle_if_need(source_files_index)
86
- if !@privacy_sources.empty?
86
+ if @privacy_sources
87
87
  privacy_resource_bundle = { "#{full_name}.privacy" => @privacy_file }
88
88
  if @has_resource_bundle
89
89
  @rows.each_with_index do |line, index|
@@ -184,7 +184,7 @@ module PrivacyModule
184
184
 
185
185
 
186
186
  # Step 6: 获取privacy 相关信息,传递给后续处理
187
- privacy_hash = fetch_privacy_hash(combin_sepcs_and_rows,podspec_file_path)
187
+ privacy_hash = fetch_privacy_hash(combin_sepcs_and_rows,podspec_file_path).compact
188
188
  filtered_privacy_hash = privacy_hash.reject { |_, value| value.empty? }
189
189
  filtered_privacy_hash
190
190
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-privacy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - youhui
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-30 00:00:00.000000000 Z
11
+ date: 2024-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler