cocoapods-tdf-bin 0.0.20 → 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: 0c0aa092f0b877d34f9d83f058a11fd05a1ba66970ea31d052139c6cf20ce067
4
- data.tar.gz: 84105568bae6e85ba0a53fba5920542e3bcdd98dfd1c0cdb63c299f40c880b85
3
+ metadata.gz: b12ad3159d7e92f44ffd550df9bf4d09646c07769d9feea345778edf575ccb8c
4
+ data.tar.gz: cc4bee203d36048b9ca59b9e83f10cf5ba2e1bc77458ebd9a4399b046984bcfa
5
5
  SHA512:
6
- metadata.gz: c11d27a445a8e609e2eee91dc2d82bd23ed8fcdb43f435173d728963f96a1bfd1767f514ac597bbc12c2c89fab4b329325cc57f37e2ff227815245e76788451a
7
- data.tar.gz: e444caa31f9bc67f4e06770d57f738e9906a1fd57082f8108f611af260116fa3214db85a2d68198f0cfcc4e9b5cfc3aae57d8f6d21f683bdcb5dae92c462da21
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
@@ -64,8 +64,15 @@ module Pod
64
64
  def run_git(podfile_instance)
65
65
  podfile_instance.get_batch_local_pods.each_value do |value|
66
66
  path = value[0][:path]
67
- arg = @arguments.join(" ")
68
- puts "============== #{path} 开始执行 git #{arg} 命令 ==============".blue
67
+ arg = @arguments.map do |v|
68
+ match_str = /\s/.match(v)
69
+ if nil != match_str
70
+ v = "\"#{v}\""
71
+ end
72
+ v
73
+ end
74
+ arg = arg.join(" ")
75
+ puts "============== #{path} 开始执行 git #{arg} 命令 ==============".tdf_blue
69
76
  puts `git -C #{path} #{arg}`
70
77
  end
71
78
  end
@@ -79,7 +86,7 @@ module Pod
79
86
  git_url = `git -C #{path} remote get-url --push origin`
80
87
  current_branch = `git -C #{path} branch --show-current`.delete!("\n")
81
88
  group_name = get_group_with_repo(git_url)
82
- puts "============== #{name} 当前分支 #{current_branch} 当前组 #{group_name} ==============".blue
89
+ puts "============== #{name} 当前分支 #{current_branch} 当前组 #{group_name} ==============".tdf_blue
83
90
 
84
91
  group_key = "#{group_name}&&#{current_branch}"
85
92
  repo_arr = group_map[group_key]
@@ -101,17 +108,29 @@ module Pod
101
108
  end
102
109
  group = key.split("&&")[0]
103
110
  branch = key.split("&&")[1]
104
- pod_remote_str << " ], \"#{branch}\", \"#{group}\"\n\n"
111
+ pod_remote_str << " ], \"#{branch}\", \"#{group}\" \n\n"
105
112
  end
106
- puts "将 local_batch 依赖 替换为 \n#{pod_remote_str}".blue
113
+ puts "将 local_batch 依赖 替换为 \n#{pod_remote_str}".tdf_blue
107
114
 
108
115
  # 替换 podfile 中的local batch
116
+ re = / *batch_pod_local *\[([^\].]*)\], *".*"/
109
117
  podfile = File.join(Pathname.pwd, "Podfile")
110
- 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)
111
130
  File.open(podfile, "r+") do |podfile|
112
131
  podfile << podfile_str
113
132
  end
114
- puts "替换成功".blue
133
+ puts "替换成功".tdf_blue
115
134
  end
116
135
 
117
136
  def find_repo_with_pod(pod_name)
@@ -1,6 +1,6 @@
1
1
 
2
2
  module CBin
3
- VERSION = '0.0.20'
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.20
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-23 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