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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e942896253a1d129115b23c8d16e0e8a48132ca908fd55c65418d8a5bc2eb852
4
- data.tar.gz: f21420c824eccac318f510e969b2283e0dd84719dc4b2f119365c0ca4b402701
3
+ metadata.gz: b58f1137fcf3c0bcfc65f809f0946fd507cbf343283526c0461b91fb7a3f87a9
4
+ data.tar.gz: 8cd669301226f7796ebe3962d757fed9c7d75c8714a035d343c7fc8f7ea06f41
5
5
  SHA512:
6
- metadata.gz: 1e4ba88019303f1233cf55550f68b29393211c8f722c6e3de943d4c8f7049eb9f265d61f298de6e15397994a64f655ef71c74881dd2117b9e45b5cbc50b1174d
7
- data.tar.gz: deb0038838eb9790bc855469bc738c589d5025592a411d4b6851b5db0f56f4f3958b6240706f4dc9df024d36edf325eaadcda28e4341167e04ec90f049b5615d
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
- ['pull', '本地库全部拉取'],
19
- ['push', '本地库全部推送'],
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 命令"
@@ -1,6 +1,6 @@
1
1
 
2
2
  module CBin
3
- VERSION = '0.0.18'
3
+ VERSION = '0.0.19'
4
4
  end
5
5
 
6
6
  module Pod
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.18
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-15 00:00:00.000000000 Z
11
+ date: 2021-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel