cocoapods-aomi-bin 0.1.9 → 0.1.14
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-lhj-bin/command/bin.rb +4 -0
- data/lib/cocoapods-lhj-bin/command/bin/config/push.rb +2 -2
- data/lib/cocoapods-lhj-bin/command/bin/local/fetch.rb +13 -5
- data/lib/cocoapods-lhj-bin/command/bin/local/filter.rb +85 -0
- data/lib/cocoapods-lhj-bin/command/bin/local/local.rb +38 -23
- data/lib/cocoapods-lhj-bin/command/bin/local/micro_service.rb +89 -0
- data/lib/cocoapods-lhj-bin/command/bin/model.rb +87 -0
- data/lib/cocoapods-lhj-bin/command/bin/reverse_import.rb +76 -0
- data/lib/cocoapods-lhj-bin/config/local_config.rb +10 -5
- data/lib/cocoapods-lhj-bin/gem_version.rb +1 -1
- data/lib/cocoapods-lhj-bin/helpers/oss_helper.rb +2 -2
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ae0f1c3d276bd9f8b0cd9a8f6fd44b98152a7e5bf47e3f9e5fd1b652173013e
|
4
|
+
data.tar.gz: eb24bbf850884f1cc01a801960a78d3d1d39cf1796d11ca350a97791bae34ffb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7232bbe4165e66208653984d2a5f92827fdd68da37109db474c0c278b364df17376eeab3f720b220cf9fe06ebf10cc3c0f5f62360ae63c86ce209ac71c28c3a0
|
7
|
+
data.tar.gz: 2ba17d477ce1401f7d7e25cb1c7b47e11a46e74572ed6dcb1b619e946a784a1d854da6b1129acf257817e14bdca3d7d0b10641588bd954d300ef4f60d3a4712f
|
@@ -6,11 +6,15 @@ require 'cocoapods-lhj-bin/command/bin/code'
|
|
6
6
|
require 'cocoapods-lhj-bin/command/bin/update'
|
7
7
|
require 'cocoapods-lhj-bin/command/bin/install'
|
8
8
|
require 'cocoapods-lhj-bin/command/bin/import'
|
9
|
+
require 'cocoapods-lhj-bin/command/bin/reverse_import'
|
9
10
|
require 'cocoapods-lhj-bin/command/bin/local/local'
|
10
11
|
require 'cocoapods-lhj-bin/command/bin/local/fetch'
|
12
|
+
require 'cocoapods-lhj-bin/command/bin/local/filter'
|
13
|
+
require 'cocoapods-lhj-bin/command/bin/local/micro_service'
|
11
14
|
require 'cocoapods-lhj-bin/command/bin/local/upload'
|
12
15
|
require 'cocoapods-lhj-bin/command/bin/trans'
|
13
16
|
require 'cocoapods-lhj-bin/command/bin/lhj'
|
17
|
+
require 'cocoapods-lhj-bin/command/bin/model'
|
14
18
|
require 'cocoapods-lhj-bin/command/bin/config/push'
|
15
19
|
require 'cocoapods-lhj-bin/command/bin/oss/list'
|
16
20
|
require 'cocoapods-lhj-bin/command/bin/oss/del'
|
@@ -18,8 +18,8 @@ module Pod
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def push_cn_hk
|
21
|
-
file = File.expand_path("#{Pod::Config.instance.home_dir}/
|
22
|
-
CBin::OSS::Helper.instance.upload('
|
21
|
+
file = File.expand_path("#{Pod::Config.instance.home_dir}/localizable_config.yml")
|
22
|
+
CBin::OSS::Helper.instance.upload('localizable_config.yml', file)
|
23
23
|
end
|
24
24
|
|
25
25
|
def push
|
@@ -50,7 +50,13 @@ module Pod
|
|
50
50
|
|
51
51
|
def handle_files
|
52
52
|
Dir.glob("#{@current_path}/**/*.{#{@file_type}}").each do |f|
|
53
|
-
|
53
|
+
dir_name = File.dirname(f)
|
54
|
+
if /Pods/ =~ f
|
55
|
+
mod_name = framework_name(dir_name)
|
56
|
+
handle_file f if /^ML/ =~ mod_name
|
57
|
+
else
|
58
|
+
handle_file f
|
59
|
+
end
|
54
60
|
end
|
55
61
|
end
|
56
62
|
|
@@ -61,7 +67,7 @@ module Pod
|
|
61
67
|
def handle_file(file)
|
62
68
|
File.open(file, 'r') do |f|
|
63
69
|
f.each_line do |line|
|
64
|
-
handle_line(file, line) if zh_ch_reg =~ line
|
70
|
+
handle_line(file, line) if zh_ch_reg =~ line && !((/DDLog/ =~ line) || (/NSLog/ =~ line))
|
65
71
|
end
|
66
72
|
end
|
67
73
|
end
|
@@ -71,6 +77,7 @@ module Pod
|
|
71
77
|
fname = File.basename(file)
|
72
78
|
dir_name = File.dirname(file)
|
73
79
|
mod_name = framework_name(dir_name)
|
80
|
+
# ('a'..'z').to_a.shuffle[0..12].join
|
74
81
|
key = "#{mod_name}.#{File.basename(file, '.*')}.#{rand(36**8).to_s(36)}"
|
75
82
|
cn_str = str[2, str.length - 3]
|
76
83
|
en_str = cn_str.gsub(/[\u4e00-\u9fa5]/, 'x')
|
@@ -102,9 +109,11 @@ module Pod
|
|
102
109
|
def update_source_header
|
103
110
|
Dir.glob("#{@current_path}/**/*.{m,h}").each do |f|
|
104
111
|
if f =~ /Pods/
|
105
|
-
|
112
|
+
dir_name = File.dirname(f)
|
113
|
+
mod_name = framework_name(dir_name)
|
114
|
+
handle_file f if /^ML/ =~ mod_name
|
106
115
|
else
|
107
|
-
handler_file
|
116
|
+
handler_file f
|
108
117
|
end
|
109
118
|
end
|
110
119
|
end
|
@@ -140,7 +149,6 @@ module Pod
|
|
140
149
|
end
|
141
150
|
result
|
142
151
|
end
|
143
|
-
|
144
152
|
end
|
145
153
|
end
|
146
154
|
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'csv'
|
4
|
+
|
5
|
+
module Pod
|
6
|
+
class Command
|
7
|
+
class Bin < Command
|
8
|
+
class Filter < Bin
|
9
|
+
self.summary = '过滤重复对象'
|
10
|
+
|
11
|
+
def initialize(argv)
|
12
|
+
@current_path = argv.shift_argument || Dir.pwd
|
13
|
+
@file_type = argv.option('file-type', 'm,h')
|
14
|
+
@file_name = argv.option('file-name', 'MaucaoLife_zh_en.csv')
|
15
|
+
@cn_keys = []
|
16
|
+
@key_map = {}
|
17
|
+
@used_keys = []
|
18
|
+
super
|
19
|
+
end
|
20
|
+
|
21
|
+
def run
|
22
|
+
fetch_keys
|
23
|
+
read_csv
|
24
|
+
gen_csv
|
25
|
+
end
|
26
|
+
|
27
|
+
def csv_file_name
|
28
|
+
file_name = @file_name
|
29
|
+
file_name = "#{@file_name}.csv" unless /.csv$/ =~ @file_name
|
30
|
+
file_name
|
31
|
+
end
|
32
|
+
|
33
|
+
def read_csv
|
34
|
+
path = File.join(@current_path, csv_file_name)
|
35
|
+
Dir.glob(path).each do |p|
|
36
|
+
CSV.foreach(p) do |row|
|
37
|
+
key = row[0]
|
38
|
+
if @used_keys.any? { |k| k.eql?(key) }
|
39
|
+
@cn_keys << { key: key, cn: row[1], en: row[2], fname: row[3], dirname: row[4] }
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def gen_csv
|
46
|
+
file = File.join(@current_path, csv_file_name)
|
47
|
+
FileUtils.rm_rf(file) if File.exist?(file)
|
48
|
+
CSV.open(file, 'wb:utf-8') do |csv|
|
49
|
+
csv << %w[国际化key 中文 英文 所在文件 文件路径]
|
50
|
+
@cn_keys.each do |k|
|
51
|
+
csv << [k[:key], k[:cn], k[:en], k[:fname], k[:dirname]]
|
52
|
+
end
|
53
|
+
end
|
54
|
+
UI.puts "生成csv文件完成.\n文件路径:#{File.absolute_path(file)}".green
|
55
|
+
end
|
56
|
+
|
57
|
+
def fetch_keys
|
58
|
+
Dir.glob("#{@current_path}/**/*.{#{@file_type}}").each do |f|
|
59
|
+
handle_file f
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def zh_ch_reg
|
64
|
+
/MLLocalizedString\([^)]+\)/
|
65
|
+
end
|
66
|
+
|
67
|
+
def handle_file(file)
|
68
|
+
File.open(file, 'r') do |f|
|
69
|
+
f.each_line do |line|
|
70
|
+
handle_line(file, line) if zh_ch_reg =~ line
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def handle_line(file, line)
|
76
|
+
line.scan(zh_ch_reg) do |str|
|
77
|
+
str[20, str.length - 22]
|
78
|
+
@used_keys << str[20, str.length - 22]
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -42,11 +42,11 @@ module Pod
|
|
42
42
|
|
43
43
|
def run
|
44
44
|
down_load_csv_file if need_download
|
45
|
-
|
45
|
+
read_csv
|
46
46
|
if @key_map.keys.length.positive?
|
47
47
|
write_en_strings
|
48
|
-
write_zh_cn_strings if CBin::LocalConfig.instance.config['gen_zh_cn']
|
49
48
|
write_zh_hk_strings
|
49
|
+
write_zh_cn_strings
|
50
50
|
handle_modify_source if @modify_source_flag
|
51
51
|
else
|
52
52
|
UI.puts "获取中英文映射文件失败, 检查参数--read-csv-file=xx是否正常\n".red
|
@@ -122,12 +122,27 @@ module Pod
|
|
122
122
|
download_keys
|
123
123
|
end
|
124
124
|
|
125
|
-
def
|
125
|
+
def read_csv
|
126
126
|
path = File.join(@current_path, read_csv_file_name)
|
127
|
-
Dir.glob(path).each do |
|
128
|
-
|
129
|
-
|
130
|
-
|
127
|
+
Dir.glob(path).each do |f|
|
128
|
+
read_csv_file f
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
def read_csv_file(file)
|
133
|
+
key_c = CBin::LocalConfig.instance.get_col_by_name(file, 'csv_key_col')
|
134
|
+
cn_c = CBin::LocalConfig.instance.get_col_by_name(file, 'csv_cn_col')
|
135
|
+
en_c = CBin::LocalConfig.instance.get_col_by_name(file, 'csv_en_col')
|
136
|
+
trans_hk = CBin::LocalConfig.instance.get_col_by_name(file, 'trans_zh_hk')
|
137
|
+
trans_cn = CBin::LocalConfig.instance.get_col_by_name(file, 'trans_zh_cn')
|
138
|
+
CSV.foreach(file) do |row|
|
139
|
+
if row.length > 2
|
140
|
+
key = row[key_c]
|
141
|
+
cn_str = row[cn_c]
|
142
|
+
hk_str = row[cn_c]
|
143
|
+
cn_str = CBin::Trans::Helper.instance.trans_zh_cn_str(cn_str) if trans_cn
|
144
|
+
hk_str = CBin::Trans::Helper.instance.trans_zh_hk_str(hk_str) if trans_hk
|
145
|
+
@key_map[key] = { key: key, cn: cn_str, hk: hk_str, en: row[en_c] } unless key =~ /[\u4e00-\u9fa5]/
|
131
146
|
end
|
132
147
|
end
|
133
148
|
end
|
@@ -170,7 +185,7 @@ module Pod
|
|
170
185
|
|
171
186
|
def modify_format_string(file, line)
|
172
187
|
result = line
|
173
|
-
result = handle_modify_line(file, line) if zh_ch_reg =~ line
|
188
|
+
result = handle_modify_line(file, line) if zh_ch_reg =~ line && !((/DDLog/ =~ line) || (/NSLog/ =~ line))
|
174
189
|
result
|
175
190
|
end
|
176
191
|
|
@@ -194,17 +209,10 @@ module Pod
|
|
194
209
|
@key_map.values[index][:key] if index
|
195
210
|
end
|
196
211
|
|
197
|
-
def format_str(type
|
212
|
+
def format_str(type)
|
198
213
|
str = ''
|
199
214
|
@key_map.each do |k, v|
|
200
|
-
|
201
|
-
case area
|
202
|
-
when :hk
|
203
|
-
val = CBin::Trans::Helper.instance.trans_zh_hk_str val
|
204
|
-
when :cn
|
205
|
-
val = CBin::Trans::Helper.instance.trans_zh_cn_str val
|
206
|
-
end
|
207
|
-
str += "\"#{k}\" = \"#{val}\";\n"
|
215
|
+
str += "\"#{k}\" = \"#{v[type]}\";\n"
|
208
216
|
end
|
209
217
|
str
|
210
218
|
end
|
@@ -229,19 +237,26 @@ module Pod
|
|
229
237
|
end
|
230
238
|
|
231
239
|
def write_zh_cn_strings
|
240
|
+
gen_zh_cn_strings_file
|
241
|
+
end
|
242
|
+
|
243
|
+
def gen_zh_cn_strings_file
|
232
244
|
file = File.join(@current_path, zh_cn_dir_name, generate_file_name)
|
233
|
-
|
234
|
-
area = :cn if CBin::LocalConfig.instance.config['trans_zh_cn']
|
235
|
-
content = format_str(:zh, area)
|
245
|
+
content = format_str(:cn)
|
236
246
|
write_to_file(file, content)
|
237
247
|
UI.puts "生成简体中文配置完成.文件路径:#{File.absolute_path(file)}\n".green
|
238
248
|
end
|
239
249
|
|
250
|
+
def copy_hk_to_cn_file
|
251
|
+
source_file = File.join(@current_path, zh_hk_dir_name, generate_file_name)
|
252
|
+
dest_file = File.join(@current_path, zh_cn_dir_name, generate_file_name)
|
253
|
+
FileUtils.cp source_file, dest_file
|
254
|
+
UI.puts "繁体中文配置覆盖简体中文配置\n".green
|
255
|
+
end
|
256
|
+
|
240
257
|
def write_zh_hk_strings
|
241
258
|
file = File.join(@current_path, zh_hk_dir_name, generate_file_name)
|
242
|
-
|
243
|
-
area = :hk if CBin::LocalConfig.instance.config['trans_zh_hk']
|
244
|
-
content = format_str(:zh, area)
|
259
|
+
content = format_str(:hk)
|
245
260
|
write_to_file(file, content)
|
246
261
|
UI.puts "生成繁体中文配置完成.文件路径:#{File.absolute_path(file)}\n".green
|
247
262
|
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'csv'
|
4
|
+
|
5
|
+
module Pod
|
6
|
+
class Command
|
7
|
+
class Bin < Command
|
8
|
+
class Service < Bin
|
9
|
+
self.summary = '微服务名变更'
|
10
|
+
|
11
|
+
def initialize(argv)
|
12
|
+
@current_path = argv.shift_argument || Dir.pwd
|
13
|
+
@file_type = argv.option('file-type', 'm,h')
|
14
|
+
@file_name = argv.option('file-name', 'service_map.csv')
|
15
|
+
@service_map = {}
|
16
|
+
super
|
17
|
+
end
|
18
|
+
|
19
|
+
def run
|
20
|
+
read_csv
|
21
|
+
update_source
|
22
|
+
end
|
23
|
+
|
24
|
+
def read_csv
|
25
|
+
path = File.join(@current_path, csv_file_name)
|
26
|
+
Dir.glob(path).each do |p|
|
27
|
+
CSV.foreach(p) do |row|
|
28
|
+
@service_map[row[0]] = row[1] if row[0]
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def csv_file_name
|
34
|
+
file_name = @file_name
|
35
|
+
file_name = "#{@file_name}.csv" unless /.csv$/ =~ @file_name
|
36
|
+
file_name
|
37
|
+
end
|
38
|
+
|
39
|
+
def update_source
|
40
|
+
Dir.glob("#{@current_path}/**/*.{m,h}").each do |f|
|
41
|
+
if f =~ /Pods/
|
42
|
+
update_file(f) if f =~ %r{Pods/ML}
|
43
|
+
else
|
44
|
+
update_file(f)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def update_file(file)
|
50
|
+
File.chmod(0o644, file)
|
51
|
+
str = file_string(file)
|
52
|
+
File.open(file, 'w+') do |f|
|
53
|
+
f.write(str)
|
54
|
+
end
|
55
|
+
File.chmod(0o444, file) if file =~ /Pods/
|
56
|
+
end
|
57
|
+
|
58
|
+
def file_string(file)
|
59
|
+
str = ''
|
60
|
+
File.open(file, 'r+') do |f|
|
61
|
+
f.each_line do |line|
|
62
|
+
str += format_string(f, line)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
str
|
66
|
+
end
|
67
|
+
|
68
|
+
def format_string(file, line)
|
69
|
+
result = line
|
70
|
+
if url_reg =~ line
|
71
|
+
line.scan(url_reg).flatten.each do |key|
|
72
|
+
result = result.gsub(key, @service_map[key]) if key && @service_map[key]
|
73
|
+
end
|
74
|
+
end
|
75
|
+
result
|
76
|
+
end
|
77
|
+
|
78
|
+
def url_reg
|
79
|
+
@url_key_reg ||= begin
|
80
|
+
keys = @service_map.keys.join('|')
|
81
|
+
/(#{keys})/
|
82
|
+
end
|
83
|
+
@url_key_reg
|
84
|
+
end
|
85
|
+
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
require 'net/https'
|
2
|
+
require 'uri'
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
module Pod
|
6
|
+
class Command
|
7
|
+
class Bin < Command
|
8
|
+
class Model < Bin
|
9
|
+
self.summary = '生成模型文件'
|
10
|
+
|
11
|
+
def initialize(argv)
|
12
|
+
@url = argv.shift_argument
|
13
|
+
@models = []
|
14
|
+
end
|
15
|
+
|
16
|
+
def run
|
17
|
+
uri = URI.parse(@url)
|
18
|
+
res = Net::HTTP.get_response(uri)
|
19
|
+
res_body = JSON.parse(res.body)
|
20
|
+
detail_msg = res_body['detailMsg']
|
21
|
+
fetch_models(nil, detail_msg) if detail_msg
|
22
|
+
print_models
|
23
|
+
end
|
24
|
+
|
25
|
+
def validate!
|
26
|
+
help! "请输入url" unless @url
|
27
|
+
end
|
28
|
+
|
29
|
+
def fetch_models(name, obj)
|
30
|
+
model = obj
|
31
|
+
model = obj.first if obj.respond_to? :<<
|
32
|
+
@models.unshift({name: name, value: model})
|
33
|
+
model.each do |key, value|
|
34
|
+
if (value.instance_of? Hash) || (value.instance_of? Array)
|
35
|
+
fetch_models(key, value)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def print_models
|
41
|
+
@models.each do |model|
|
42
|
+
model_name = ''
|
43
|
+
model_name = model[:name].gsub('List', '').gsub('Vo', '').gsub(/^\w/) { $&.upcase } if model[:name]
|
44
|
+
puts "@interface ML#{model_name}Model : NSObject"
|
45
|
+
model[:value].each do |key, value|
|
46
|
+
print_property(key, value)
|
47
|
+
end
|
48
|
+
puts "@end\n\n"
|
49
|
+
puts "@implementation ML#{model_name}Model"
|
50
|
+
if model[:name]
|
51
|
+
puts "+(NSDictionary *)modelContainerPropertyGenericClass {"
|
52
|
+
puts " return @{@\"#{model[:name]}\" : ML#{model_name}Model.class};"
|
53
|
+
puts "}"
|
54
|
+
end
|
55
|
+
puts "@end\n\n\n"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def print_property(key, value)
|
60
|
+
if value.instance_of? String
|
61
|
+
puts "///#{value}"
|
62
|
+
puts "@property (nonatomic, copy) NSString *#{key};"
|
63
|
+
elsif value.instance_of? Integer
|
64
|
+
puts "///#{value}"
|
65
|
+
puts "@property (nonatomic, assign) NSInteger #{key};"
|
66
|
+
puts "///#{value}" if value > 1000
|
67
|
+
puts "@property (nonatomic, strong) MLCentNumber *#{key};" if value > 1000
|
68
|
+
elsif value.instance_of? Float
|
69
|
+
puts "///#{value}"
|
70
|
+
puts "@property (nonatomic, assign) CGFloat #{key};"
|
71
|
+
elsif (value.instance_of? TrueClass) || (value.instance_of? FalseClass)
|
72
|
+
puts "///#{value}"
|
73
|
+
puts "@property (nonatomic, assign) BOOL #{key};"
|
74
|
+
elsif value.instance_of? Array
|
75
|
+
puts "///#{key}"
|
76
|
+
name = key.gsub('List', '').gsub('Vo', '').gsub(/^\w/) { $&.upcase }
|
77
|
+
puts "@property (nonatomic, strong) NSArray<ML#{name}Model *> *#{key};"
|
78
|
+
elsif value.instance_of? Hash
|
79
|
+
puts "///#{key}"
|
80
|
+
name = key.gsub('List', '').gsub('Vo', '').gsub(/^\w/) { $&.upcase }
|
81
|
+
puts "@property (nonatomic, strong) ML#{name}Model *#{key};"
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'find'
|
4
|
+
require 'fileutils'
|
5
|
+
|
6
|
+
module Pod
|
7
|
+
class Command
|
8
|
+
class Bin < Command
|
9
|
+
class ReverseImport < Bin
|
10
|
+
self.summary = '更改头文件引入'
|
11
|
+
|
12
|
+
def initialize(argv)
|
13
|
+
@current_path = argv.shift_argument || Dir.pwd
|
14
|
+
@framework_names = []
|
15
|
+
super
|
16
|
+
end
|
17
|
+
|
18
|
+
def run
|
19
|
+
get_all_frameworks
|
20
|
+
get_import_headers
|
21
|
+
end
|
22
|
+
|
23
|
+
def get_import_headers
|
24
|
+
Dir.glob("#{@current_path}/**/*.{m,h,pch}").each do |f|
|
25
|
+
header_handler_file(f) unless f =~ /Pods/
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def get_all_frameworks
|
30
|
+
folders = child_dir
|
31
|
+
folders.each { |name| @framework_names << name }
|
32
|
+
end
|
33
|
+
|
34
|
+
def framework_name_reg
|
35
|
+
@url_key_reg ||= begin
|
36
|
+
keys = @framework_names.join('|')
|
37
|
+
/#{keys}/
|
38
|
+
end
|
39
|
+
@url_key_reg
|
40
|
+
end
|
41
|
+
|
42
|
+
def pod_folder_name
|
43
|
+
File.join(@current_path, 'MacauLife', 'CustomPods')
|
44
|
+
end
|
45
|
+
|
46
|
+
def child_dir
|
47
|
+
dirs = Dir.entries(pod_folder_name)
|
48
|
+
dirs.reject!{ |d| File.directory?(d) }
|
49
|
+
dirs
|
50
|
+
end
|
51
|
+
|
52
|
+
def import_reg
|
53
|
+
/#import\s*<(.*)\/(.*)>$/
|
54
|
+
end
|
55
|
+
|
56
|
+
def header_handler_file(f)
|
57
|
+
str = ''
|
58
|
+
File.readlines(f).each do |l|
|
59
|
+
if import_reg =~ l
|
60
|
+
ma = l.match(import_reg)
|
61
|
+
if framework_name_reg =~ ma[1]
|
62
|
+
str += "#import \"#{ma[2]}\"\n"
|
63
|
+
else
|
64
|
+
str += l.dup
|
65
|
+
end
|
66
|
+
else
|
67
|
+
str += l.dup
|
68
|
+
end
|
69
|
+
end
|
70
|
+
File.write(f, str)
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -33,11 +33,16 @@ module CBin
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def load_config
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
36
|
+
syn_config_file unless File.exist?(config_file)
|
37
|
+
YAML.load_file(config_file)
|
38
|
+
end
|
39
|
+
|
40
|
+
def get_col_by_name(file_name, col_name = 'csv_key_col')
|
41
|
+
m = config
|
42
|
+
col = m[col_name]
|
43
|
+
fo = m['read_targets'].find{ |o| /#{o['csv_file']}/ =~ file_name }
|
44
|
+
col = fo[col_name] if fo
|
45
|
+
col
|
41
46
|
end
|
42
47
|
|
43
48
|
def config
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-aomi-bin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lihaijian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods
|
@@ -118,11 +118,15 @@ files:
|
|
118
118
|
- lib/cocoapods-lhj-bin/command/bin/lhj.rb
|
119
119
|
- lib/cocoapods-lhj-bin/command/bin/lib/lint.rb
|
120
120
|
- lib/cocoapods-lhj-bin/command/bin/local/fetch.rb
|
121
|
+
- lib/cocoapods-lhj-bin/command/bin/local/filter.rb
|
121
122
|
- lib/cocoapods-lhj-bin/command/bin/local/local.rb
|
123
|
+
- lib/cocoapods-lhj-bin/command/bin/local/micro_service.rb
|
122
124
|
- lib/cocoapods-lhj-bin/command/bin/local/upload.rb
|
125
|
+
- lib/cocoapods-lhj-bin/command/bin/model.rb
|
123
126
|
- lib/cocoapods-lhj-bin/command/bin/oss/del.rb
|
124
127
|
- lib/cocoapods-lhj-bin/command/bin/oss/list.rb
|
125
128
|
- lib/cocoapods-lhj-bin/command/bin/repo/update.rb
|
129
|
+
- lib/cocoapods-lhj-bin/command/bin/reverse_import.rb
|
126
130
|
- lib/cocoapods-lhj-bin/command/bin/spec/create.rb
|
127
131
|
- lib/cocoapods-lhj-bin/command/bin/spec/push.rb
|
128
132
|
- lib/cocoapods-lhj-bin/command/bin/trans.rb
|