cocoapods-soul-component-plugin 0.0.24 → 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: 16202b06a32ecde0021d9d5f79f09c22db0919e014a657311f015de3b4375603
4
- data.tar.gz: d6fce98e9929402afd92586625de4b76121c0310f90fca98081547b1c5b489ff
3
+ metadata.gz: 881560b2fbce0d30bf498e475bc7ec8aa8128b102e4cdb5df090121dd3c24b74
4
+ data.tar.gz: d699ed64ec2e90a4283fb688da80fd503a98647d78ae9a07d27ca36011f4e506
5
5
  SHA512:
6
- metadata.gz: 8032bcd3f05babec3cdce060b5a6b2cea46b4493b5d0180217c9dc8733c780b59bdd1a38cc94069fab974361caff7aa23b23b584fbb5dbeb2aac948dbef4586a
7
- data.tar.gz: c2e741e1f8deb86642a472e672cd7051aac71042cd8277414b08b78adda2095537c572dec1f0b807540d2ae8681b7f5374512c5f36463e8d0d05a1de3a9dc99b
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
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module CocoapodsSoulComponentPlugin
3
- VERSION = '0.0.24'
3
+ VERSION = '0.0.25'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-soul-component-plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.24
4
+ version: 0.0.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - fang