cocoapods-aomi-bin 0.1.5 → 0.1.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 +4 -4
- data/lib/cocoapods-lhj-bin/command/bin/local/local.rb +12 -12
- data/lib/cocoapods-lhj-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: 2de50f4edfa779b9e90f5ae4e184d6f6fa16dfa30ccb8391315eed1f5fcf2400
|
4
|
+
data.tar.gz: f2148de18be3ad11c18f1456407f912378c4ff3110185baaaa525438c99b8256
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cad276b5fa7153d116e8bf4cbd9461b563329b7492ddf12a21536de3ed57d409d46f6cc211d6bf612b3f0f37994f3e487bf6f354fad2fca7d145479e2a993d5a
|
7
|
+
data.tar.gz: cd8cbe520df055dbaaa779221e9dc2856e49bfd7b20bf1bcf23604306e36399f17e7020e0d8c5b94445100a96e7758a5189b9a5a4fd7f8e1d5928c31f69ecad8
|
@@ -75,27 +75,27 @@ module Pod
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def down_load_csv_file
|
78
|
-
UI.puts '下载中英对照csv文件...'.green
|
79
78
|
ary = get_download_keys
|
80
79
|
ary.each do |key|
|
81
|
-
file_name =
|
80
|
+
file_name = File.basename(key)
|
82
81
|
file = File.join(@current_path, file_name)
|
83
82
|
backup_csv_file file if File.exist?(file)
|
84
|
-
UI.puts "下载csv文件:#{key} 到目录#{file}".green
|
83
|
+
UI.puts "下载csv文件:#{CBin::OSS::Helper.instance.object_url(key)} 到目录#{file}\n".green
|
85
84
|
CBin::OSS::Helper.instance.down_load(key, file)
|
86
85
|
end
|
86
|
+
UI.puts "下载云端csv文件完成 \n".green
|
87
87
|
end
|
88
88
|
|
89
89
|
def backup_csv_file(file)
|
90
90
|
dest_file = bak_file(file)
|
91
|
+
FileUtils.mkdir_p(File.dirname(dest_file)) unless File.exist?(File.dirname(dest_file))
|
91
92
|
UI.puts "备份csv文件:#{file} 到目录#{dest_file}".green
|
92
93
|
FileUtils.cp file, dest_file
|
93
94
|
FileUtils.rm_rf file
|
94
95
|
end
|
95
96
|
|
96
97
|
def bak_file(file)
|
97
|
-
|
98
|
-
dest_file = File.join(File.dirname(file), bak_name)
|
98
|
+
dest_file = File.join(File.dirname(file), 'csv_bak', File.basename(file))
|
99
99
|
File.exist?(dest_file) ? bak_file(dest_file) : dest_file
|
100
100
|
end
|
101
101
|
|
@@ -150,15 +150,15 @@ module Pod
|
|
150
150
|
|
151
151
|
def modify_format_string(file, line)
|
152
152
|
result = line
|
153
|
-
result = handle_modify_line line if line =~ /@"[^"]*[\u4e00-\u9fa5]+[^"]*"/
|
153
|
+
result = handle_modify_line(file, line) if line =~ /@"[^"]*[\u4e00-\u9fa5]+[^"]*"/
|
154
154
|
result
|
155
155
|
end
|
156
156
|
|
157
|
-
def handle_modify_line(line)
|
157
|
+
def handle_modify_line(file, line)
|
158
158
|
result = line
|
159
159
|
reg = /@"[^"]*[\u4e00-\u9fa5]+[^"]*"/
|
160
160
|
ma = reg.match(line)
|
161
|
-
key = find_key_by_cn_val(ma[0])
|
161
|
+
key = find_key_by_cn_val(file, ma[0])
|
162
162
|
if key
|
163
163
|
val = format(@modify_format_string, "@\"#{key}\"")
|
164
164
|
result = line.gsub(ma[0], val)
|
@@ -166,11 +166,11 @@ module Pod
|
|
166
166
|
result
|
167
167
|
end
|
168
168
|
|
169
|
-
def find_key_by_cn_val(val)
|
169
|
+
def find_key_by_cn_val(file, val)
|
170
|
+
file_name = File.basename(file, '.*')
|
170
171
|
cn_key = val[2, val.length - 3]
|
171
|
-
index = @key_map.values.find_index
|
172
|
-
|
173
|
-
end
|
172
|
+
index = @key_map.values.find_index { |obj| /^#{cn_key}$/ =~ obj[:zh] && /^#{file_name}/ =~ obj[:key] }
|
173
|
+
index ||= @key_map.values.find_index { |obj| /^#{cn_key}$/ =~ obj[:zh] }
|
174
174
|
@key_map.values[index][:key] if index
|
175
175
|
end
|
176
176
|
|
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.6
|
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-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods
|