cocoapods-tdf-bin 0.0.23 → 0.0.24

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: 30e09fa1c06817b81845bb30564c4f046f60026990f59cf5b1d653b3a13b4c63
4
- data.tar.gz: 6281408285d3e6f4198018df41ee9ed23e305365329ebc3e4f93c11136fb67a3
3
+ metadata.gz: b12ad3159d7e92f44ffd550df9bf4d09646c07769d9feea345778edf575ccb8c
4
+ data.tar.gz: cc4bee203d36048b9ca59b9e83f10cf5ba2e1bc77458ebd9a4399b046984bcfa
5
5
  SHA512:
6
- metadata.gz: 47a1b3cbef0298c86a83aa435cd98f45eea8ad4ddfddda44bc89ab670a722bdbd8bb865b58b8cfb55ddd7ffc67117ace2c421b1cdd92a02eae271de60e93a8e1
7
- data.tar.gz: 43e2823464c66110ee42d0b0be869e6a7dd0623e6abd77bb03eaffc2176182694af252a623b2dd2aeb91256602fa655f992cf4f3ab1619670ad7dd24b739728b
6
+ metadata.gz: 21663273f73583007da2afb7c44fdfbe7dd287b4e402f3ec9887b89affbe7b4646fc8674a3cabd302534e93678b2b6822e98d4ca50a6f952b2a98378bb481d3f
7
+ data.tar.gz: 90212296c1ecde617fe82904aee89e295770f02467678a3fa8f2eb8076e22fc6b6da71c3268074c9178f1a2525f830a7cad8a4a4be1dd18bbf8119970357114e
@@ -56,7 +56,7 @@ module Pod
56
56
  local_pods.each_key do |name|
57
57
  path = local_pods[name][0][:path]
58
58
  repo_url = find_repo_with_pod(name)
59
- puts "============== #{name} 开始 clone 到 #{path}==============".blue
59
+ puts "============== #{name} 开始 clone 到 #{path}==============".tdf_blue
60
60
  puts `git clone #{repo_url} #{path}`
61
61
  end
62
62
  end
@@ -72,7 +72,7 @@ module Pod
72
72
  v
73
73
  end
74
74
  arg = arg.join(" ")
75
- puts "============== #{path} 开始执行 git #{arg} 命令 ==============".blue
75
+ puts "============== #{path} 开始执行 git #{arg} 命令 ==============".tdf_blue
76
76
  puts `git -C #{path} #{arg}`
77
77
  end
78
78
  end
@@ -86,7 +86,7 @@ module Pod
86
86
  git_url = `git -C #{path} remote get-url --push origin`
87
87
  current_branch = `git -C #{path} branch --show-current`.delete!("\n")
88
88
  group_name = get_group_with_repo(git_url)
89
- puts "============== #{name} 当前分支 #{current_branch} 当前组 #{group_name} ==============".blue
89
+ puts "============== #{name} 当前分支 #{current_branch} 当前组 #{group_name} ==============".tdf_blue
90
90
 
91
91
  group_key = "#{group_name}&&#{current_branch}"
92
92
  repo_arr = group_map[group_key]
@@ -108,17 +108,29 @@ module Pod
108
108
  end
109
109
  group = key.split("&&")[0]
110
110
  branch = key.split("&&")[1]
111
- pod_remote_str << " ], \"#{branch}\", \"#{group}\"\n\n"
111
+ pod_remote_str << " ], \"#{branch}\", \"#{group}\" \n\n"
112
112
  end
113
- puts "将 local_batch 依赖 替换为 \n#{pod_remote_str}".blue
113
+ puts "将 local_batch 依赖 替换为 \n#{pod_remote_str}".tdf_blue
114
114
 
115
115
  # 替换 podfile 中的local batch
116
+ re = / *batch_pod_local *\[([^\].]*)\], *".*"/
116
117
  podfile = File.join(Pathname.pwd, "Podfile")
117
- podfile_str = File.read(podfile).gsub(/ *batch_pod_local *\[([^\].]*)\], *".*"/, pod_remote_str)
118
+ podfile_str = File.read(podfile)
119
+
120
+ local_pod_str = podfile_str.match(re).to_s
121
+ local_pod_lines = local_pod_str.to_s.split("\n")
122
+ local_pod_lines = local_pod_lines.map do |s|
123
+ "# #{s}"
124
+ end
125
+ local_pod_str = local_pod_lines.join("\n")
126
+ local_pod_str << "\n"
127
+ pod_remote_str.insert(0, local_pod_str)
128
+
129
+ podfile_str = podfile_str.gsub(re, pod_remote_str)
118
130
  File.open(podfile, "r+") do |podfile|
119
131
  podfile << podfile_str
120
132
  end
121
- puts "替换成功".blue
133
+ puts "替换成功".tdf_blue
122
134
  end
123
135
 
124
136
  def find_repo_with_pod(pod_name)
@@ -1,6 +1,6 @@
1
1
 
2
2
  module CBin
3
- VERSION = '0.0.23'
3
+ VERSION = '0.0.24'
4
4
  end
5
5
 
6
6
  module Pod
@@ -1,30 +1,30 @@
1
1
  class String
2
2
  # colorization
3
- def colorize(color_code)
3
+ def tdf_colorize(color_code)
4
4
  "\e[#{color_code}m#{self}\e[0m"
5
5
  end
6
6
 
7
- def red
8
- colorize(31)
7
+ def tdf_red
8
+ tdf_colorize(31)
9
9
  end
10
10
 
11
- def green
12
- colorize(32)
11
+ def tdf_green
12
+ tdf_colorize(32)
13
13
  end
14
14
 
15
- def yellow
16
- colorize(33)
15
+ def tdf_yellow
16
+ tdf_colorize(33)
17
17
  end
18
18
 
19
- def blue
20
- colorize(34)
19
+ def tdf_blue
20
+ tdf_colorize(34)
21
21
  end
22
22
 
23
- def pink
24
- colorize(35)
23
+ def tdf_pink
24
+ tdf_colorize(35)
25
25
  end
26
26
 
27
- def light_blue
28
- colorize(36)
27
+ def tdf_light_blue
28
+ tdf_colorize(36)
29
29
  end
30
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-tdf-bin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.23
4
+ version: 0.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - gaijiaofan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-26 00:00:00.000000000 Z
11
+ date: 2021-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel