cocoapods-privacy 0.0.5 → 0.1.0

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: 9e2c2edb2a21e1dc73f639fab1bd7b78eda9e0caeecd8597378c8f8b4c4f35c2
4
- data.tar.gz: 8f98ddf47a36beebbc8c80b3da3fad5f0cfccfd0a0b491e81af13bf1f156e16f
3
+ metadata.gz: 169d976a4180a55f5ad139c4db9c1693eeccf2147077d92aa638eaf65ca4314f
4
+ data.tar.gz: 63cc1f7128d7117ecf373408c1309fa21917b3c06588b59b000b10de6eeb65c2
5
5
  SHA512:
6
- metadata.gz: 407e0cf2c260455f3bfed2232b656317b140759018dae8ce9eb6aa605c3df316d07ef772c23b2aa823a03790088257c5763e5bf73f2e70d0342783df5c953fc6
7
- data.tar.gz: 5c2859958cdfafb1ef978d1ede514595caaaf73a9bd864a84eb7a1522f0d40768a3310b67d7206b68c95f16514a9b22cb014e6b23215cbd70e19d2f861ccd1c2
6
+ metadata.gz: 6cff9908e2198aa3068029f9e1b40603bfa279d73933f7099763cd91be76128db9e3b000cdf9182dfe84f11ced41954c63e0524041b8c8e681138fb29416df8b
7
+ data.tar.gz: 564d4fa4e65c300b9009e54e54747728c5cc0f57b25c8e566a9ed0a5323d98044dd53efe22fd1c307fc9ebf38f309f028cdc72f18052123990c4740d0775dd35
@@ -1,3 +1,3 @@
1
1
  module CocoapodsPrivacy
2
- VERSION = "0.0.5"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -41,6 +41,7 @@ class BBSpec
41
41
  end
42
42
 
43
43
  def privacy_handle(podspec_file_path)
44
+ source_files_index = 1
44
45
  @rows.each_with_index do |line, index|
45
46
  if !line || line.is_a?(BBSpec) || !line.key || line.key.empty?
46
47
  next
@@ -62,6 +63,7 @@ class BBSpec
62
63
  source_files_array = []
63
64
  end
64
65
 
66
+ source_files_index = index
65
67
  @privacy_sources = source_files_array.map do |file_path|
66
68
  File.join(File.dirname(podspec_file_path), file_path.strip)
67
69
  end
@@ -69,7 +71,7 @@ class BBSpec
69
71
  end
70
72
  end
71
73
  create_privacy_file_if_need(podspec_file_path)
72
- modify_privacy_resource_bundle_if_need()
74
+ modify_privacy_resource_bundle_if_need(source_files_index)
73
75
  end
74
76
 
75
77
  # 对应Spec新增隐私文件
@@ -80,7 +82,7 @@ class BBSpec
80
82
  end
81
83
 
82
84
  # 把新增的隐私文件 映射给 podspec
83
- def modify_privacy_resource_bundle_if_need
85
+ def modify_privacy_resource_bundle_if_need(source_files_index)
84
86
  if !@privacy_sources.empty?
85
87
  privacy_resource_bundle = { "#{full_name}.privacy" => @privacy_file }
86
88
  if @has_resource_bundle
@@ -99,11 +101,11 @@ class BBSpec
99
101
  end
100
102
  end
101
103
  else
102
- space = PrivacyUtils.count_spaces_before_first_character(rows.first.content)
104
+ space = PrivacyUtils.count_spaces_before_first_character(rows[source_files_index].content)
103
105
  line = "#{alias_name}.resource_bundle = #{privacy_resource_bundle}"
104
- line = PrivacyUtils.add_spaces_to_string(line,space + 2)
106
+ line = PrivacyUtils.add_spaces_to_string(line,space)
105
107
  row = BBRow.new(line)
106
- @rows.insert(1, row)
108
+ @rows.insert(source_files_index+1, row)
107
109
  end
108
110
  end
109
111
  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.0.5
4
+ version: 0.1.0
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-26 00:00:00.000000000 Z
11
+ date: 2024-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler