cocoapods-aomi-bin 0.1.12 → 0.1.13
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/config/push.rb +2 -2
- data/lib/cocoapods-lhj-bin/command/bin/local/local.rb +26 -26
- 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 +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ae3af0a13e50fda02f0dc94b7167bcc90dfbaeb4dbf7e41dacbbf473adbf584
|
4
|
+
data.tar.gz: cf58dc5598b22637808983c72c38d7051d9c927aa34769c7a8cf8429c970e90a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3837f523f1839690351f4d660a2735daf00bd50641175c9bf95c77f8e4c2f851ec4f171e52ebbfedcaa0fb8bffd54285493ee31443c844834700f8b1f5b4b30b
|
7
|
+
data.tar.gz: 83f0c980b2e5a8459dd4e406b86ec68fb7b6dd55e79d282659d52cd936ef6595bd391a40f47430eb3aa863a7a14fa54ee575eb392f30641764d412639b888c2a
|
@@ -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
|
@@ -42,7 +42,7 @@ 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
48
|
write_zh_hk_strings
|
@@ -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
|
@@ -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,18 +237,12 @@ module Pod
|
|
229
237
|
end
|
230
238
|
|
231
239
|
def write_zh_cn_strings
|
232
|
-
|
233
|
-
gen_zh_cn_strings_file
|
234
|
-
else
|
235
|
-
copy_hk_to_cn_file
|
236
|
-
end
|
240
|
+
gen_zh_cn_strings_file
|
237
241
|
end
|
238
242
|
|
239
243
|
def gen_zh_cn_strings_file
|
240
244
|
file = File.join(@current_path, zh_cn_dir_name, generate_file_name)
|
241
|
-
|
242
|
-
area = :cn if CBin::LocalConfig.instance.config['trans_zh_cn']
|
243
|
-
content = format_str(:zh, area)
|
245
|
+
content = format_str(:cn)
|
244
246
|
write_to_file(file, content)
|
245
247
|
UI.puts "生成简体中文配置完成.文件路径:#{File.absolute_path(file)}\n".green
|
246
248
|
end
|
@@ -254,9 +256,7 @@ module Pod
|
|
254
256
|
|
255
257
|
def write_zh_hk_strings
|
256
258
|
file = File.join(@current_path, zh_hk_dir_name, generate_file_name)
|
257
|
-
|
258
|
-
area = :hk if CBin::LocalConfig.instance.config['trans_zh_hk']
|
259
|
-
content = format_str(:zh, area)
|
259
|
+
content = format_str(:hk)
|
260
260
|
write_to_file(file, content)
|
261
261
|
UI.puts "生成繁体中文配置完成.文件路径:#{File.absolute_path(file)}\n".green
|
262
262
|
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.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lihaijian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods
|