cocoapods-anker-ar 1.2.0 → 1.2.1

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: a12a0c8334bae3fa0d0b53a6a5cf0480ca0d0fa2fec3d3b9a0eb324b67534a05
4
- data.tar.gz: d8bff5397f7262b366e5ad61b22424defe4d4a74dd36860c3df1014ec7ba8919
3
+ metadata.gz: 53d87b175c6ad2c28fd275fca7d098217545acc5132fcccf89084e5725c1b0fa
4
+ data.tar.gz: 1ec89fbaadae87a458ce6390f7f7b47a9fc4117b5d7142eb9661ce78233a0523
5
5
  SHA512:
6
- metadata.gz: de8a4b20398dff205da4f52e982b5edbc5e5fdd428e3e51c0c1e2b9f18d1e732f6aa8c4633a0e52b82c7e07cee39763f7a0bbd985ae07b9900bb3eb399f8b0f6
7
- data.tar.gz: 2a18ff5a74d03cb4c790e70961b581bb82623ffa0cbc56157afae15bb80f7c41814766862a03572d0926cb4d40d02b7abf20dd433a6c0c3b65a8966d8e407eaa
6
+ metadata.gz: '0951275ac2c303879914b1f3e09bffaaf4d1bcddaf6e1dae3e3e85fa35d2fe55befa9cca7dfcfbce9eba578fee064f6f3e34e83d28fefd42ef03c4673f9eae20'
7
+ data.tar.gz: 0e9df006388d9261d60647d7ee1b3b32bb38ccada256d1e167eff558efe9a339515f2c2abb273b4331f5f56e81b6ec2e67ea3dd2cfa37ee42301d4660fa7b620
@@ -1,3 +1,3 @@
1
1
  module CocoapodsAnkerAr
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
@@ -9,30 +9,32 @@ module Pod
9
9
  [:type, :flatten, :sha1, :sha256, :indexDownload]
10
10
  end
11
11
 
12
- alias_method :orig_download_file, :download_file
13
- alias_method :orig_should_flatten?, :should_flatten?
14
-
15
- def download_file(full_filename)
16
- # Check if this is a CODING-AR URL
17
- if url.to_s.include?('codingcorp-cocoapods.pkg.coding.anker-in.com')
18
- CodingArUtil.download(url, full_filename)
19
- else
20
- orig_download_file(full_filename)
12
+ # Use prepend instead of alias_method to safely monkey-patch without
13
+ # infinite recursion when the plugin is loaded more than once.
14
+ module AnkerArExtensions
15
+ def download_file(full_filename)
16
+ if url.to_s.include?('codingcorp-cocoapods.pkg.coding.anker-in.com')
17
+ CodingArUtil.download(url, full_filename)
18
+ else
19
+ super
20
+ end
21
21
  end
22
- end
23
22
 
24
- def should_flatten?
25
- if options.key?(:indexDownload) && options[:indexDownload] == true
26
- true
27
- elsif url.to_s.include?('codingcorp-cocoapods.pkg.coding.anker-in.com')
28
- # For CODING-AR packages, preserve directory structure to maintain .xcframework layout
29
- # Use indexDownload: true in podspec if flattening is needed
30
- puts "🔧 [CocoaPods-Anker-AR] Preserving directory structure for CODING-AR package"
31
- false
32
- else
33
- orig_should_flatten?
23
+ def should_flatten?
24
+ if options.key?(:indexDownload) && options[:indexDownload] == true
25
+ true
26
+ elsif url.to_s.include?('codingcorp-cocoapods.pkg.coding.anker-in.com')
27
+ # For CODING-AR packages, preserve directory structure to maintain .xcframework layout
28
+ # Use indexDownload: true in podspec if flattening is needed
29
+ puts "🔧 [CocoaPods-Anker-AR] Preserving directory structure for CODING-AR package"
30
+ false
31
+ else
32
+ super
33
+ end
34
34
  end
35
35
  end
36
+
37
+ prepend AnkerArExtensions
36
38
  end
37
39
  end
38
40
  end
@@ -40,40 +42,43 @@ end
40
42
  module Pod
41
43
  class Source
42
44
  class Manager
43
- alias_method :orig_source_from_path, :source_from_path
44
- alias_method :orig_create_source_with_url, :create_source_with_url
45
+ # Use prepend instead of alias_method to safely monkey-patch without
46
+ # infinite recursion when the plugin is loaded more than once.
47
+ module AnkerArExtensions
48
+ def source_from_path(path)
49
+ @sources_by_path ||= Hash.new do |hash, key|
50
+ hash[key] = case
51
+ when key.basename.to_s == Pod::TrunkSource::TRUNK_REPO_NAME
52
+ TrunkSource.new(key)
53
+ when (key + '.url').exist?
54
+ CDNSource.new(key)
55
+ when (key + '.coding_ar_url').exist?
56
+ CodingArSource.new(key)
57
+ else
58
+ Source.new(key)
59
+ end
60
+ end
45
61
 
46
- def source_from_path(path)
47
- @sources_by_path ||= Hash.new do |hash, key|
48
- hash[key] = case
49
- when key.basename.to_s == Pod::TrunkSource::TRUNK_REPO_NAME
50
- TrunkSource.new(key)
51
- when (key + '.url').exist?
52
- CDNSource.new(key)
53
- when (key + '.coding_ar_url').exist?
54
- CodingArSource.new(key)
55
- else
56
- Source.new(key)
57
- end
62
+ @sources_by_path[path]
58
63
  end
59
64
 
60
- @sources_by_path[path]
61
- end
65
+ def create_source_with_url(url)
66
+ require 'coding_ar_util'
62
67
 
63
- def create_source_with_url(url)
64
- require 'coding_ar_util'
65
-
66
- name = name_for_url(url)
67
- if CodingArUtil.coding_ar_service?(url)
68
- Command::Repo::AddCodingAr.parse([name, url]).run
69
- else
70
- orig_create_source_with_url(url)
71
- end
68
+ name = name_for_url(url)
69
+ if CodingArUtil.coding_ar_service?(url)
70
+ Command::Repo::AddCodingAr.parse([name, url]).run
71
+ else
72
+ super
73
+ end
72
74
 
73
- source = source_with_url(url)
74
- raise "Unable to create a source with URL #{url}" unless source
75
- source
75
+ source = source_with_url(url)
76
+ raise "Unable to create a source with URL #{url}" unless source
77
+ source
78
+ end
76
79
  end
80
+
81
+ prepend AnkerArExtensions
77
82
  end
78
83
  end
79
84
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-anker-ar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dark Liu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-03-31 00:00:00.000000000 Z
11
+ date: 2026-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler