cocoapods-tdf-bin 0.0.18 → 0.0.19
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 +4 -4
- data/lib/cocoapods-tdf-bin/command/bin/batch.rb +44 -4
- data/lib/cocoapods-tdf-bin/gem_version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b58f1137fcf3c0bcfc65f809f0946fd507cbf343283526c0461b91fb7a3f87a9
|
4
|
+
data.tar.gz: 8cd669301226f7796ebe3962d757fed9c7d75c8714a035d343c7fc8f7ea06f41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdf308408a6030c385995956553f2cdf13de2b41a964c17e4b5d1ef811fd91809694048d260ebd0e39fbb3573f5818b1e19775953fb23fb0eb50d4737d2c52a0
|
7
|
+
data.tar.gz: 4f6201140a65d724e4409ac7f3067eab97b22f2d7bf7e60deba4fe4a47be302c075f6cca324a532ab6c7148d958c5ab68de40911431f0166a1390881a7152b3b
|
@@ -15,10 +15,8 @@ module Pod
|
|
15
15
|
|
16
16
|
def self.options
|
17
17
|
[
|
18
|
-
['
|
19
|
-
['
|
20
|
-
['chenckout {分支名}', '切换指定分支'],
|
21
|
-
['chenckout -b {分支名}', '切出指定分支'],
|
18
|
+
['clone', '本地库全部 clone 到指定本地目录'],
|
19
|
+
['{ git 命令 }', '本地库全部执行 git 命令,比如 pod bin batch pull, pod bin batch checkout -b feature/***'],
|
22
20
|
]
|
23
21
|
end
|
24
22
|
|
@@ -30,6 +28,27 @@ module Pod
|
|
30
28
|
def run
|
31
29
|
podfile = File.join(Pathname.pwd, "Podfile")
|
32
30
|
podfile_instance = Pod::Podfile.from_file(podfile)
|
31
|
+
if podfile_instance.get_batch_local_pods == nil
|
32
|
+
help! "没有本地依赖的组件"
|
33
|
+
end
|
34
|
+
if @arguments.size == 1 && @arguments[0] == "clone"
|
35
|
+
clone_all(podfile_instance)
|
36
|
+
else
|
37
|
+
run_git(podfile_instance)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def clone_all(podfile_instance)
|
42
|
+
local_pods = podfile_instance.get_batch_local_pods
|
43
|
+
local_pods.each_key do |name|
|
44
|
+
path = local_pods[name][0][:path]
|
45
|
+
repo_url = find_repo_with_pod(name)
|
46
|
+
puts "============== #{name} 开始 clone 到 #{path}==============".blue
|
47
|
+
puts `git clone #{repo_url} #{path}`
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def run_git(podfile_instance)
|
33
52
|
podfile_instance.get_batch_local_pods.each_value do |value|
|
34
53
|
path = value[0][:path]
|
35
54
|
arg = @arguments.join(" ")
|
@@ -38,7 +57,28 @@ module Pod
|
|
38
57
|
end
|
39
58
|
end
|
40
59
|
|
60
|
+
def find_repo_with_pod(pod_name)
|
61
|
+
sources = config.sources_manager.all
|
62
|
+
sources = sources.select do |s|
|
63
|
+
s.name == "2dfire-cocoapods-spec"
|
64
|
+
end
|
65
|
+
source = sources[0]
|
66
|
+
repo_path = source.repo.to_s + "/#{pod_name}"
|
67
|
+
versions = `ls #{repo_path}`.split("\n")
|
68
|
+
versions = versions.sort do |x ,y|
|
69
|
+
y<=>x
|
70
|
+
end
|
71
|
+
last_version = versions[0]
|
72
|
+
spec_file = `ls #{repo_path}/#{last_version}`.split("\n")[0]
|
73
|
+
spec = Pod::Spec.from_file("#{repo_path}/#{last_version}/#{spec_file}")
|
74
|
+
git_url = spec.attributes_hash["source"]["git"]
|
75
|
+
git_url
|
76
|
+
end
|
77
|
+
|
41
78
|
def validate!
|
79
|
+
if @arguments.size < 1
|
80
|
+
help! "命令参数不够"
|
81
|
+
end
|
42
82
|
git = `which git`
|
43
83
|
if git.empty?
|
44
84
|
help! "没有安装 git 命令"
|
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.
|
4
|
+
version: 0.0.19
|
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-
|
11
|
+
date: 2021-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|