cocoapods-tag 0.0.5 → 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: 750b94770c7e64be7c2fec845a40ec5f131b3bf37d401a25d5707e943e61eb18
|
4
|
+
data.tar.gz: 71f223370e85b4711acfcdd347b1ba4534f39eabf35828e8b1d6116887b0da86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '099976d089ecaea62b573739b974970f1d3f590a880abede27ebcde14b7cb50ceb41d1fa4b223c20d5d7a91f6f107646a1941b47332def8788bc26c23edee383'
|
7
|
+
data.tar.gz: 8b6c5f648ae71bf9a59470f28c18f375f954c067f5fc07047268425d371b4291c19571fab2a026c7ab13f444fbd717dfe5a5a0573fc7328589537b14f7aad93c
|
@@ -0,0 +1,77 @@
|
|
1
|
+
|
2
|
+
module Pod
|
3
|
+
class Command
|
4
|
+
class Tag < Command
|
5
|
+
class RepoList < Tag
|
6
|
+
include Pod
|
7
|
+
|
8
|
+
self.summary = '打印本地的 podspec 仓库'
|
9
|
+
|
10
|
+
self.description = <<-DESC
|
11
|
+
#{self.summary}
|
12
|
+
DESC
|
13
|
+
|
14
|
+
def self.options
|
15
|
+
[
|
16
|
+
['--format=FORMAT', '输出结果格式化,可选项为`json/yml(yaml)/plain`'],
|
17
|
+
].concat(super)
|
18
|
+
end
|
19
|
+
|
20
|
+
def initialize(argv)
|
21
|
+
@format = argv.option('format', 'plain')
|
22
|
+
super
|
23
|
+
end
|
24
|
+
|
25
|
+
def run
|
26
|
+
@sources = config.sources_manager.all
|
27
|
+
if @format == 'json'
|
28
|
+
print_json
|
29
|
+
elsif @format == 'yml' || @format == 'yaml'
|
30
|
+
print_yml
|
31
|
+
else
|
32
|
+
print_plain
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def print_json
|
39
|
+
require 'json'
|
40
|
+
UI.puts JSON.pretty_generate(sources)
|
41
|
+
end
|
42
|
+
|
43
|
+
def print_yml
|
44
|
+
require 'yaml'
|
45
|
+
UI.puts sources.to_yaml
|
46
|
+
end
|
47
|
+
|
48
|
+
def print_plain
|
49
|
+
list = Pod::Command::Repo::List.new(CLAide::ARGV.new([]))
|
50
|
+
list.validate!
|
51
|
+
list.run
|
52
|
+
end
|
53
|
+
|
54
|
+
def sources
|
55
|
+
result = []
|
56
|
+
@sources.each do |source|
|
57
|
+
type = source.type
|
58
|
+
if source.is_a?(Pod::CDNSource)
|
59
|
+
type = 'CDN'
|
60
|
+
elsif source.git?
|
61
|
+
type = 'git'
|
62
|
+
end
|
63
|
+
source_hash = {
|
64
|
+
'name' => source.name,
|
65
|
+
'url' => source.url,
|
66
|
+
'path' => source.repo.to_s,
|
67
|
+
'type' => type
|
68
|
+
}
|
69
|
+
result << source_hash
|
70
|
+
end
|
71
|
+
result
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
data/lib/cocoapods-tag/tag.rb
CHANGED
@@ -157,6 +157,10 @@ module Pod
|
|
157
157
|
if source['git'] && source['git'].strip == ''
|
158
158
|
raise Informative, "source中git字段不能为空"
|
159
159
|
end
|
160
|
+
# git字段只能是ssh
|
161
|
+
if source['git'] && source['git'] =~ /^(http|https)/
|
162
|
+
raise Informative, "source中git字段不能是http或https,只能是ssh"
|
163
|
+
end
|
160
164
|
end
|
161
165
|
|
162
166
|
# 修改podspec
|
@@ -178,8 +182,8 @@ module Pod
|
|
178
182
|
def modify_podspec_ruby(file)
|
179
183
|
org_source = @spec_hash['source']
|
180
184
|
des_source = "{ :git => '#{org_source['git']}', :tag => '#{@tag}' }"
|
185
|
+
lines = []
|
181
186
|
File.open(file, 'r:utf-8') do |f|
|
182
|
-
lines = []
|
183
187
|
f.each_line do |line|
|
184
188
|
if line =~ /(^\s*.+\.version\s*=\s*).*/
|
185
189
|
line = line.sub(/(^\s*.+\.version\s*=\s*).*/, "#{$1}'#{@version}'")
|
@@ -189,9 +193,9 @@ module Pod
|
|
189
193
|
end
|
190
194
|
lines << line
|
191
195
|
end
|
192
|
-
|
193
|
-
|
194
|
-
|
196
|
+
end
|
197
|
+
File.open(file, 'w:utf-8') do |f|
|
198
|
+
f.write(lines.join(""))
|
195
199
|
end
|
196
200
|
end
|
197
201
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-tag
|
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
|
- Jensen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods
|
@@ -66,6 +66,7 @@ files:
|
|
66
66
|
- lib/cocoapods-tag/command/tag.rb
|
67
67
|
- lib/cocoapods-tag/command/tag/auto.rb
|
68
68
|
- lib/cocoapods-tag/command/tag/create.rb
|
69
|
+
- lib/cocoapods-tag/command/tag/repo_list.rb
|
69
70
|
- lib/cocoapods-tag/command/tag/spec_push.rb
|
70
71
|
- lib/cocoapods-tag/gem_version.rb
|
71
72
|
- lib/cocoapods-tag/helper/asker.rb
|