cocoapods-soul-component-plugin 0.0.23 → 0.0.25

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: 597ad6367a29c757573150c23a60335a6129f9b95fec90188b85e53cb8749411
4
- data.tar.gz: 8ce3b18b3d10fb49f995795eba84d4b491993776ae1ae7d02b4b0914e9f6a5fd
3
+ metadata.gz: 881560b2fbce0d30bf498e475bc7ec8aa8128b102e4cdb5df090121dd3c24b74
4
+ data.tar.gz: d699ed64ec2e90a4283fb688da80fd503a98647d78ae9a07d27ca36011f4e506
5
5
  SHA512:
6
- metadata.gz: 9af5affec61d0e30db9815e4ed5796154784253d9d93d8fe9d42ceccfa792f3f042d1010c5ab9379a53f93fabf5ebaa54451013144efb74fbec19cb17d341562
7
- data.tar.gz: 5a6fbdbd2f06f9030e0c6e0e8815dec642bf2372d1e29548020c5153555837211ba645cdafd7703dc14e7f52d81d73a03977ca6374bf176f95408e402f592972
6
+ metadata.gz: 66cde3e7d8cc094b0e2c22ad3593b7e389e17595bf2ad67f3936e1164d3cc334efe649d0499330abdb8d0d90688c9609de4dca1e6fca2330a879fefe70d37d0b
7
+ data.tar.gz: 7c0772870d6e4218810aa0db38186ef45b469022ff09a66e57c4384faca436754f4ac375a7465788fbccc0a9581c31b620cf3d0e55d6581756614857ad2cc25a
@@ -6,9 +6,55 @@ require 'json'
6
6
  require 'xcodeproj'
7
7
  require 'cocoapods-downloader'
8
8
  require 'cocoapods/user_interface'
9
- require 'hash-deep-merge'
9
+ # require 'hash-deep-merge'
10
10
  require_relative '../gem_version'
11
+ class Hash
11
12
 
13
+ def deep_merge!(specialized_hash)
14
+ return internal_deep_merge!(self, specialized_hash)
15
+ end
16
+
17
+
18
+ def deep_merge(specialized_hash)
19
+ return internal_deep_merge!(Hash.new.replace(self), specialized_hash)
20
+ end
21
+
22
+
23
+ protected
24
+
25
+ # better, recursive, preserving method
26
+ # OK OK this is not the most efficient algorithm,
27
+ # but at last it's *perfectly clear and understandable*
28
+ # so fork and improve if you need 5% more speed, ok ?
29
+ def internal_deep_merge!(source_hash, specialized_hash)
30
+
31
+ #puts "starting deep merge..."
32
+
33
+ specialized_hash.each_pair do |rkey, rval|
34
+ #puts " potential replacing entry : " + rkey.inspect
35
+
36
+ if source_hash.has_key?(rkey) then
37
+ #puts " found potentially conflicting entry for #{rkey.inspect} : #{rval.inspect}, will merge :"
38
+ if rval.is_a?(Hash) and source_hash[rkey].is_a?(Hash) then
39
+ #puts " recursing..."
40
+ internal_deep_merge!(source_hash[rkey], rval)
41
+ elsif rval == source_hash[rkey] then
42
+ #puts " same value, skipping."
43
+ else
44
+ #puts " replacing."
45
+ source_hash[rkey] = rval
46
+ end
47
+ else
48
+ #puts " found new entry #{rkey.inspect}, adding it..."
49
+ source_hash[rkey] = rval
50
+ end
51
+ end
52
+
53
+ #puts "deep merge done."
54
+
55
+ return source_hash
56
+ end
57
+ end
12
58
  module Pod
13
59
  module Downloader
14
60
  class Git < Base
@@ -215,7 +261,18 @@ module CocoapodsSoulComponentPlugin
215
261
  each.path = target_path
216
262
 
217
263
  if File.exist?(target_path) == false
218
- options = { git: each.git, commit: each.commit, tag: each.version, branch: each.branch }
264
+ # 使用优先顺序 commit>branch>tag
265
+ c = each.commit
266
+ b = each.branch
267
+ v = each.version
268
+ if (c != nil)
269
+ v = nil
270
+ b = nil
271
+ end
272
+ if (b != nil)
273
+ v = nil
274
+ end
275
+ options = { git: each.git, commit: c, tag: v, branch: b }
219
276
  # 这行代码会自动清空branch并且设置commit
220
277
  # options = Pod::Downloader.preprocess_options(options)
221
278
  downloader = Pod::Downloader.for_target(target_path, options)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module CocoapodsSoulComponentPlugin
3
- VERSION = '0.0.23'
3
+ VERSION = '0.0.25'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-soul-component-plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.23
4
+ version: 0.0.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - fang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-06 00:00:00.000000000 Z
11
+ date: 2024-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler