cocoapods-TSPodfileTimeWatch 0.0.1 → 0.0.6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05f3029a264c746bad75546fd5078dad1b3c4a52df5b8e84213bf496f2b95b44
|
4
|
+
data.tar.gz: 4a9178680d3a2b55e0d140f73d6d6efad3d8d80617fc773a813dc0b93007a174
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c97101f15106ce4c16bc96b36eef69592741a63423d46ea160fa1c5271604755b62d3e1ed152e75ebb05cb6f133f9546151a90ca758adcd960b44e4d325b380
|
7
|
+
data.tar.gz: bca7180391d7a8b0860fce2d871c1ead8f8841944774b60b7ab5ad33b1ca890abf404500e29e66abdc624b315f94766f02592cba43f95a6f3283515be02b57fa
|
data/README.md
CHANGED
@@ -1,11 +1,43 @@
|
|
1
1
|
# cocoapods-TSPodfileTimeWatch
|
2
2
|
|
3
|
-
A description of cocoapods-TSPodfileTimeWatch.
|
4
3
|
|
5
|
-
|
4
|
+
|
5
|
+
## 统计每个pod库下载耗时插件
|
6
|
+
[](https://imgchr.com/i/Bb8zIx)
|
7
|
+
|
8
|
+
## 安装:
|
9
|
+
|
10
|
+
使用cocoapods plugin的方式实现
|
6
11
|
|
7
12
|
$ gem install cocoapods-TSPodfileTimeWatch
|
8
13
|
|
9
|
-
##
|
14
|
+
## 使用方法
|
15
|
+
|
16
|
+
1.gem install cocoapods-TSPodfileTimeWatch(安装cocoapods-TSPodfileTimeWatch)
|
17
|
+
|
18
|
+
2.删除pods文件夹
|
19
|
+
|
20
|
+
3.删除podfile.lock文件
|
21
|
+
|
22
|
+
4.删除pod缓存(pod cache clean --all)
|
23
|
+
|
24
|
+
5.在podfile起始加入:
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
# 在这里判断是否启动插件,再加个异常保护
|
28
|
+
begin
|
29
|
+
if system "gem list | grep \"cocoapods-TSPodfileTimeWatch\""
|
30
|
+
# 判断是否有装cocoapods-TSPodfileTimeWatch插件
|
31
|
+
plugin "cocoapods-TSPodfileTimeWatch"
|
32
|
+
end
|
33
|
+
# 其他plugin...
|
34
|
+
end
|
35
|
+
```
|
36
|
+
|
37
|
+
6.执行pod update --verbose(或者是pod install --verbose,但是一定要加--verbose,只有加了--verbose才会输出csv以及详细下载耗时信息)
|
38
|
+
|
39
|
+
7.pod结束后会在pods文件夹下生成AllPodsTimeAndSize.csv文件,用来记录所有pod下载耗时情况
|
40
|
+
|
41
|
+
8.如果git clone文件大小和cache文件大的差值越大,说明下载的多余文件越多,则存在可优化空间。
|
10
42
|
|
11
|
-
|
43
|
+
9.可以通过尝试把podfile中使用git commit集成的,修改为使用git tag集成的方式,减少git clone下载内容
|
data/lib/cocoapods_plugin.rb
CHANGED
@@ -10,7 +10,7 @@ class Dir
|
|
10
10
|
path = File.join(dir, entry)
|
11
11
|
FileTest.directory?(path) ? sum += Dir.size(path) : sum += File.size(path)
|
12
12
|
rescue => exception
|
13
|
-
puts "\e[31mCocoapodsTSPodfileTimeWatch Dir.size error: #{exception}\e[0m"
|
13
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch Dir.size error(已捕获): #{exception}\e[0m"
|
14
14
|
next
|
15
15
|
retry
|
16
16
|
end
|
@@ -18,87 +18,309 @@ class Dir
|
|
18
18
|
sum
|
19
19
|
end
|
20
20
|
end
|
21
|
-
$
|
21
|
+
$pluginIsVerbose = false
|
22
|
+
$pluginCurrentTarget = ""
|
23
|
+
$pluginCurrentPodName = ""
|
24
|
+
$pluginCurrentZipSize = 0
|
25
|
+
$pluginCurrentZipAllSize = 0
|
22
26
|
$gitSize = 0
|
27
|
+
$gitAllSize = 0
|
23
28
|
$cloneTime = 0
|
29
|
+
$cloneAllTime = 0
|
30
|
+
$downloadTime = 0
|
31
|
+
$downloadAllTime = 0
|
32
|
+
$cdnDownloadTime = 0
|
33
|
+
$cdnDownloadAllTime = 0
|
34
|
+
$cdnUnZipTime = 0
|
35
|
+
$cdnUnZipAllTime = 0
|
36
|
+
if ARGV.include?("--verbose")
|
37
|
+
$pluginIsVerbose = true
|
38
|
+
end
|
39
|
+
|
24
40
|
module CocoapodsTSPodfileTimeWatch
|
41
|
+
|
42
|
+
Pod::HooksManager.register("cocoapods-TSPodfileTimeWatch", :pre_install) do |context|
|
43
|
+
begin
|
44
|
+
if $pluginIsVerbose == true
|
45
|
+
# home路径下是否存在.AllPodsTimeAndSize.csv的隐藏文件
|
46
|
+
if File.exist?("#{Dir.home}/.AllPodsTimeAndSize.csv")
|
47
|
+
# 如果存在则先删除,每次都生成新的csv文件
|
48
|
+
File.delete("#{Dir.home}/.AllPodsTimeAndSize.csv")
|
49
|
+
end
|
50
|
+
# 统计到csv中
|
51
|
+
CSV.open("#{Dir.home}/.AllPodsTimeAndSize.csv", "ab:utf-8") do |csv|
|
52
|
+
csv << ["\xEF\xBB\xBF名称", "下载耗时(S)", "下载文件大小(M)", "cache文件大小(M)", "大小差值(Git专用)", "CDN/Git", "CDN下载耗时", "CDN解压耗时"]
|
53
|
+
end
|
54
|
+
end
|
55
|
+
rescue => exception
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
59
|
+
Pod::HooksManager.register("cocoapods-TSPodfileTimeWatch", :post_install) do |context|
|
60
|
+
begin
|
61
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch GitCloneAllSize: #{$gitAllSize} M\e[0m"
|
62
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch GitCloneAllTime: #{$cloneAllTime} S\e[0m"
|
63
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch CDNDownloadAllSize: #{$pluginCurrentZipAllSize} M\e[0m"
|
64
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch CDNAllTime: #{$downloadAllTime} S\e[0m"
|
65
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch CDNDownloadAllTime: #{$cdnDownloadAllTime} S\e[0m"
|
66
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch CDNUnzipAllTime: #{$cdnUnZipAllTime} S\e[0m"
|
67
|
+
# 如果是--verbose模式且$gitAllSize与$cloneAllTime(不为0表示有下载pod)
|
68
|
+
if $pluginIsVerbose == true && $gitAllSize != 0 && $cloneAllTime != 0 && $pluginCurrentZipAllSize != 0 && $downloadAllTime != 0
|
69
|
+
File.rename "#{Dir.home}/.AllPodsTimeAndSize.csv", "#{context.sandbox_root}/AllPodsTimeAndSize.csv"
|
70
|
+
puts "\e[31m具体的统计数据请在#{context.sandbox_root}/AllPodsTimeAndSize.csv中查看\e[0m"
|
71
|
+
end
|
72
|
+
rescue => exception
|
73
|
+
# 如果没有下载则#{Dir.home}/.AllPodsTimeAndSize.csv文件不会生成,产生异常
|
74
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch post_install error(已捕获): #{exception}\e[0m"
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
25
78
|
class Pod::Downloader::Cache
|
26
79
|
# 使用方法别名hook copy_and_clean方法
|
27
80
|
alias :origin_copy_and_clean :copy_and_clean
|
28
81
|
def copy_and_clean(source, destination, spec)
|
29
82
|
# 执行之前的拷贝到cache并且清除git clone临时目录的方法
|
30
83
|
origin_copy_and_clean(source, destination, spec)
|
31
|
-
#
|
32
|
-
if $
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
84
|
+
# 如果是--verbose,则输出详细信息,生成csv
|
85
|
+
if $pluginIsVerbose == true
|
86
|
+
verboseCopy_and_clean(source, destination, spec)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# --verbose输出详细信息,生成在home路径下.AllPodsTimeAndSize.csv的隐藏文件
|
91
|
+
def verboseCopy_and_clean(source, destination, spec)
|
92
|
+
begin
|
93
|
+
# 计算拷贝到的目录下所有文件总大小,单位为M
|
94
|
+
dirSum = Dir.size(destination.to_s)/1000.0/1000.0
|
95
|
+
# 标红输出cache文件大小,单位为M
|
96
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch cachesize #{spec.name}: "+"#{dirSum}"+" M\e[0m"
|
97
|
+
# 如果相等则为CDN的下载方式
|
98
|
+
if $gitSize == 0
|
99
|
+
# CDN的下载方式
|
100
|
+
CSV.open("#{Dir.home}/.AllPodsTimeAndSize.csv", "a+") do |csv|
|
101
|
+
csv << [spec.name, $downloadTime, $pluginCurrentZipSize, dirSum, "CDN不统计此项", "CDN", $cdnDownloadTime, $cdnUnZipTime]
|
102
|
+
end
|
103
|
+
else
|
104
|
+
# git的下载方式
|
38
105
|
# 计算git clone大小和cache文件大小的差值,如果差值过大,则有优化空间
|
39
106
|
diffSize = $gitSize - dirSum
|
40
107
|
# 标红输出差值
|
41
|
-
puts "\e[31mCocoapodsTSPodfileTimeWatch diffSize = #{diffSize}\e[0m"
|
42
|
-
#
|
43
|
-
|
44
|
-
csv << [spec.name, $cloneTime, $gitSize, dirSum, diffSize]
|
108
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch diffSize = #{diffSize}"+"M \e[0m"
|
109
|
+
CSV.open("#{Dir.home}/.AllPodsTimeAndSize.csv", "a+") do |csv|
|
110
|
+
csv << [spec.name, $cloneTime, $gitSize, dirSum, diffSize, "Git", "Git不统计此项", "Git不统计此项"]
|
45
111
|
end
|
46
|
-
# 换行
|
47
|
-
puts
|
48
|
-
rescue => exception
|
49
|
-
# 输出拷贝清除方法异常
|
50
|
-
puts "\e[31mCocoapodsTSPodfileTimeWatch copy_and_clean error: #{exception}\e[0m"
|
51
112
|
end
|
113
|
+
|
114
|
+
# 换行
|
115
|
+
puts
|
116
|
+
|
117
|
+
rescue => exception
|
118
|
+
# 输出拷贝清除方法异常
|
119
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch verboseCopy_and_clean error(已捕获): #{exception}\e[0m"
|
52
120
|
end
|
53
|
-
$currentPodName = ""
|
54
121
|
$gitSize = 0
|
55
122
|
end
|
56
123
|
end
|
57
124
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
125
|
+
|
126
|
+
class Pod::Downloader::Cache
|
127
|
+
|
128
|
+
alias :origin_download :download
|
129
|
+
|
130
|
+
def download(request, target)
|
131
|
+
# 获取downloader下载的文件路径
|
132
|
+
source = target.to_s
|
133
|
+
# 赋值当前正在下载的文件路径给全局变量,为了解压zip的时候做判断
|
134
|
+
$pluginCurrentTarget = source
|
135
|
+
# 赋值当前正在下载的pod名称给全局变量,为了解压zip的时候做输出
|
136
|
+
$pluginCurrentPodName = request.name.to_s
|
62
137
|
# 获取clone执行前时间点
|
63
138
|
time1 = Time.new
|
139
|
+
# 执行之前的download_source方法,接收该方法的返回值
|
140
|
+
result, podspecs = origin_download(request, target)
|
64
141
|
|
65
|
-
#
|
66
|
-
origin_clone(force_head, shallow_clone)
|
67
|
-
|
142
|
+
# 如果不是--verbose,只输出总耗时,总下载大小
|
68
143
|
# 捕获一下异常,不会因为plugin的原因导致pod失败
|
69
144
|
begin
|
70
145
|
# 获取clone执行后时间点
|
71
|
-
time2 = Time.
|
72
|
-
|
146
|
+
time2 = Time.new
|
73
147
|
# 获取时间差
|
74
148
|
time = time2 - time1
|
149
|
+
if request.params["git".to_sym]
|
150
|
+
# 说明是git方式
|
151
|
+
# 赋值一个给全局变量,之后时间统计要用到
|
152
|
+
$cloneTime = time
|
153
|
+
# 赋值一个给全局变量,之后时间统计要用到
|
154
|
+
$cloneAllTime = $cloneAllTime + time
|
155
|
+
# 计算downloader下载的文件大小,单位为M
|
156
|
+
dirSum = Dir.size(source)/1000.0/1000.0
|
157
|
+
# 赋值给一个全局变量,之后输出会用到
|
158
|
+
$gitAllSize = $gitAllSize + dirSum
|
159
|
+
else
|
160
|
+
# 说明是CDN方式
|
161
|
+
# 赋值一个给全局变量,之后时间统计要用到
|
162
|
+
$downloadTime = time
|
163
|
+
# 赋值一个给全局变量,之后时间统计要用到
|
164
|
+
$downloadAllTime = $downloadAllTime + time
|
165
|
+
# 赋值给一个全局变量,之后输出会用到
|
166
|
+
$cdnDownloadAllTime = $cdnDownloadAllTime + $cdnDownloadTime
|
167
|
+
# 赋值给一个全局变量,之后输出会用到
|
168
|
+
$cdnUnZipAllTime = $cdnUnZipAllTime + $cdnUnZipTime
|
169
|
+
# 赋值给一个全局变量,之后输出会用到
|
170
|
+
$pluginCurrentZipAllSize = $pluginCurrentZipAllSize + $pluginCurrentZipSize
|
171
|
+
end
|
172
|
+
|
173
|
+
# 如果是--verbose,则输出详细信息,生成csv
|
174
|
+
if $pluginIsVerbose == true
|
175
|
+
verboseDownload(request, time, dirSum)
|
176
|
+
end
|
177
|
+
# 返回值
|
178
|
+
[result, podspecs]
|
179
|
+
rescue => exception
|
180
|
+
# 标红输出git clone hook异常
|
181
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch download error(已捕获): #{exception}\e[0m"
|
182
|
+
end
|
183
|
+
end
|
75
184
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
# 这里只能根据url获取到pod名称的开始index
|
80
|
-
start = url.rindex("/") + 1
|
81
|
-
# 获取pod名称
|
82
|
-
podName = url[start, url.length]
|
83
|
-
# 赋值给一个全局变量,之后输出会用到
|
84
|
-
$currentPodName = podName
|
185
|
+
def verboseDownload(request, time, dirSum)
|
186
|
+
if request.params["git".to_sym]
|
187
|
+
# 说明是git方式
|
85
188
|
# 标红输出git clone耗时
|
86
|
-
puts "\e[31mCocoapodsTSPodfileTimeWatch #{
|
87
|
-
|
88
|
-
# 获取git clone下载的文件路径
|
89
|
-
source = target_path.to_s
|
90
|
-
# 计算git clone下载的文件大小,单位为M
|
91
|
-
dirSum = Dir.size(source)/1000.0/1000.0
|
189
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch #{request.name.to_s} clone time: #{time}"+" S\e[0m"
|
92
190
|
# 赋值给一个全局变量,之后输出会用到
|
93
191
|
$gitSize = dirSum
|
94
|
-
|
95
192
|
# 标红输出git clone下载文件大小
|
96
|
-
puts "\e[31mCocoapodsTSPodfileTimeWatch #{
|
193
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch #{request.name.to_s} clone allsize: "+"#{dirSum}"+" M\e[0m"
|
194
|
+
else
|
195
|
+
# 说明是CDN方式
|
196
|
+
# 标红输出CDN 下载耗时
|
197
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch #{request.name.to_s} CDN download time: #{$cdnDownloadTime}"+" S\e[0m"
|
198
|
+
# 标红输出CDN 解压耗时
|
199
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch #{request.name.to_s} CDN unzip time: #{$cdnUnZipTime}"+" S\e[0m"
|
200
|
+
# 标红输出CDN 总耗时
|
201
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch #{request.name.to_s} CDN All time: #{$downloadTime}"+" S\e[0m"
|
202
|
+
# 标红输出CDN clone下载文件大小
|
203
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch #{request.name.to_s} CDN zipSize: "+"#{$pluginCurrentZipSize}"+" M\e[0m"
|
204
|
+
end
|
205
|
+
|
206
|
+
end
|
207
|
+
|
208
|
+
end
|
209
|
+
|
210
|
+
class Pod::Downloader::Http
|
211
|
+
# 使用方法别名hook解压方法,获取解压之前的文件大小
|
212
|
+
alias :origin_download_file :download_file
|
213
|
+
alias :origin_extract_with_type :extract_with_type
|
214
|
+
|
215
|
+
def download_file(_full_filename)
|
216
|
+
# 捕获一下异常,不会因为plugin的原因导致pod失败
|
217
|
+
begin
|
218
|
+
if _full_filename.to_s.include?($pluginCurrentTarget)
|
219
|
+
# 说明是之前被赋值的开始下载了
|
220
|
+
|
221
|
+
# 获取CDN下载执行前时间点
|
222
|
+
time1 = Time.new
|
223
|
+
# 执行原来的CDN下载方法
|
224
|
+
origin_download_file(_full_filename)
|
225
|
+
# 获取CDN下载执行后时间点
|
226
|
+
time2 = Time.new
|
227
|
+
# 赋值CDN下载耗时给全局变量,用于之后输出以及写在csv中
|
228
|
+
$cdnDownloadTime = time2 - time1
|
229
|
+
else
|
230
|
+
# 说明不是之前被赋值的开始下载了,输出一下,然后清空
|
231
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch unzip warning: #{$pluginCurrentTarget} target error\e[0m"
|
232
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch unzip warning: #{$pluginCurrentPodName} name error\e[0m"
|
233
|
+
$pluginCurrentTarget = ""
|
234
|
+
$pluginCurrentPodName = ""
|
235
|
+
end
|
97
236
|
rescue => exception
|
98
|
-
#
|
99
|
-
puts "\e[31mCocoapodsTSPodfileTimeWatch
|
237
|
+
# 输出CDM下载方法异常
|
238
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch download_file error(已捕获): #{exception}\e[0m"
|
100
239
|
end
|
101
240
|
|
102
241
|
end
|
242
|
+
|
243
|
+
def extract_with_type(full_filename, type = :zip)
|
244
|
+
# 捕获一下异常,不会因为plugin的原因导致pod失败
|
245
|
+
begin
|
246
|
+
if full_filename.to_s.include?($pluginCurrentTarget)
|
247
|
+
# 说明是之前被赋值的下载完成了,开始进行解压了
|
248
|
+
|
249
|
+
# 计算拷贝到的目录下所有文件总大小,单位为M
|
250
|
+
dirSum = File.size(full_filename.to_s)/1000.0/1000.0
|
251
|
+
# 赋值给当前正在解压的zip大小,之后输出到csv要用
|
252
|
+
$pluginCurrentZipSize = dirSum
|
253
|
+
else
|
254
|
+
# 说明不是之前被赋值的下载完成了,输出一下,然后清空
|
255
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch unzip warning: #{$pluginCurrentTarget} target error\e[0m"
|
256
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch unzip warning: #{$pluginCurrentPodName} name error\e[0m"
|
257
|
+
$pluginCurrentTarget = ""
|
258
|
+
$pluginCurrentPodName = ""
|
259
|
+
end
|
260
|
+
rescue => exception
|
261
|
+
# 输出CDN解压方法异常
|
262
|
+
puts "\e[31mCocoapodsTSPodfileTimeWatch extract_with_type error(已捕获): #{exception}\e[0m"
|
263
|
+
end
|
264
|
+
# 获取CDN解压前时间点
|
265
|
+
time1 = Time.new
|
266
|
+
# 执行之前的解压方法
|
267
|
+
origin_extract_with_type(full_filename, type)
|
268
|
+
# 获取CDN解压后时间点
|
269
|
+
time2 = Time.new
|
270
|
+
# 赋值CDN解压耗时给全局变量,用于之后输出以及写在csv中
|
271
|
+
$cdnUnZipTime = time2 - time1
|
272
|
+
end
|
103
273
|
end
|
274
|
+
|
275
|
+
# class Pod::Downloader::Git
|
276
|
+
# # 使用方法别名hook clone方法
|
277
|
+
# alias :origin_clone :clone
|
278
|
+
# def clone(force_head = false, shallow_clone = true)
|
279
|
+
# # 获取clone执行前时间点
|
280
|
+
# time1 = Time.new
|
281
|
+
# # 执行之前的clone方法
|
282
|
+
# origin_clone(force_head, shallow_clone)
|
283
|
+
|
284
|
+
# # 如果不是--verbose,只输出总耗时,总下载大小
|
285
|
+
# # 捕获一下异常,不会因为plugin的原因导致pod失败
|
286
|
+
# begin
|
287
|
+
# # 获取clone执行后时间点
|
288
|
+
# time2 = Time.new
|
289
|
+
# # 获取时间差
|
290
|
+
# time = time2 - time1
|
291
|
+
# # 赋值一个给全局变量,之后时间统计要用到
|
292
|
+
# $cloneTime = time
|
293
|
+
# # 赋值一个给全局变量,之后时间统计要用到
|
294
|
+
# $cloneAllTime = $cloneAllTime + time
|
295
|
+
# # 获取git clone下载的文件路径
|
296
|
+
# source = target_path.to_s
|
297
|
+
# # 计算git clone下载的文件大小,单位为M
|
298
|
+
# dirSum = Dir.size(source)/1000.0/1000.0
|
299
|
+
# # 赋值给一个全局变量,之后输出会用到
|
300
|
+
# $gitAllSize = $gitAllSize + dirSum
|
301
|
+
# # 如果是--verbose,则输出详细信息,生成csv
|
302
|
+
# if $pluginIsVerbose == true
|
303
|
+
# verboseClone(force_head, shallow_clone, time, dirSum)
|
304
|
+
# end
|
305
|
+
# rescue => exception
|
306
|
+
# # 标红输出git clone hook异常
|
307
|
+
# puts "\e[31mCocoapodsTSPodfileTimeWatch clone error(已捕获): #{exception}\e[0m"
|
308
|
+
# end
|
309
|
+
|
310
|
+
# end
|
311
|
+
|
312
|
+
# # --verbose输出每个库的下载耗时
|
313
|
+
# def verboseClone(force_head, shallow_clone, time, dirSum)
|
314
|
+
# # 这里只能根据url获取到pod名称的开始index
|
315
|
+
# start = url.rindex("/") + 1
|
316
|
+
# # 获取pod名称
|
317
|
+
# podName = url[start, url.length]
|
318
|
+
# # 标红输出git clone耗时
|
319
|
+
# puts "\e[31mCocoapodsTSPodfileTimeWatch #{podName} clone time: #{time}\e[0m"
|
320
|
+
# # 赋值给一个全局变量,之后输出会用到
|
321
|
+
# $gitSize = dirSum
|
322
|
+
# # 标红输出git clone下载文件大小
|
323
|
+
# puts "\e[31mCocoapodsTSPodfileTimeWatch #{podName} clone allsize: "+"#{dirSum}"+"M\e[0m"
|
324
|
+
# end
|
325
|
+
# end
|
104
326
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-TSPodfileTimeWatch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- keai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|