cocoapods-aomi-bin 0.1.6 → 0.1.7

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: 2de50f4edfa779b9e90f5ae4e184d6f6fa16dfa30ccb8391315eed1f5fcf2400
4
- data.tar.gz: f2148de18be3ad11c18f1456407f912378c4ff3110185baaaa525438c99b8256
3
+ metadata.gz: daeba67369d05792796bf13709af702f4ed8937c74f4a66755fc02160a4cc8e9
4
+ data.tar.gz: 1f4db6b1b3609a580b14da4b6d548ec17b4fc8d16d06e1ae85f199695c65f088
5
5
  SHA512:
6
- metadata.gz: cad276b5fa7153d116e8bf4cbd9461b563329b7492ddf12a21536de3ed57d409d46f6cc211d6bf612b3f0f37994f3e487bf6f354fad2fca7d145479e2a993d5a
7
- data.tar.gz: cd8cbe520df055dbaaa779221e9dc2856e49bfd7b20bf1bcf23604306e36399f17e7020e0d8c5b94445100a96e7758a5189b9a5a4fd7f8e1d5928c31f69ecad8
6
+ metadata.gz: d96eb617e47fa8bf0e399d610d8aab68a30b21fac029168a2c4839b4ae3570b839f4f71a1e518a954bff1cb822c635ec1c47d052fad147daa8e9e423930ed5c5
7
+ data.tar.gz: 94e010fbd073a784cf9a4be53e961dc922b201cd51d69bb35221c301d782b9da500902df86b4f8b0e3d3d4e29f4bbafeefaa20dc689f6e2f8923ec7bc3b28a3f
@@ -52,21 +52,24 @@ module Pod
52
52
  end
53
53
  end
54
54
 
55
+ def zh_ch_reg
56
+ /@"[^"]*[\u4e00-\u9fa5]+[^"]*"/
57
+ end
58
+
55
59
  def handle_file(file)
56
60
  File.open(file, 'r') do |f|
57
61
  f.each_line do |line|
58
- handle_line(file, line) if line =~ /@"[^"]*[\u4e00-\u9fa5]+[^"]*"/
62
+ handle_line(file, line) if zh_ch_reg =~ line
59
63
  end
60
64
  end
61
65
  end
62
66
 
63
67
  def handle_line(file, line)
64
- reg = /@"[^"]*[\u4e00-\u9fa5]+[^"]*"/
65
- ma = reg.match(line)
66
- str = ma[0]
67
- key = "#{File.basename(file, '.*')}.#{rand(36**8).to_s(36)}"
68
- @cn_keys << { key: key, cn: str[2, str.length - 3], en: '', str: str, dirname: File.dirname(file),
69
- fname: File.basename(file) }
68
+ line.scan(zh_ch_reg) do |str|
69
+ key = "#{File.basename(file, '.*')}.#{rand(36**8).to_s(36)}"
70
+ @cn_keys << { key: key, cn: str[2, str.length - 3], en: '', str: str, dirname: File.dirname(file),
71
+ fname: File.basename(file) }
72
+ end
70
73
  end
71
74
  end
72
75
  end
@@ -148,20 +148,24 @@ module Pod
148
148
  str
149
149
  end
150
150
 
151
+ def zh_ch_reg
152
+ /@"[^"]*[\u4e00-\u9fa5]+[^"]*"/
153
+ end
154
+
151
155
  def modify_format_string(file, line)
152
156
  result = line
153
- result = handle_modify_line(file, line) if line =~ /@"[^"]*[\u4e00-\u9fa5]+[^"]*"/
157
+ result = handle_modify_line(file, line) if zh_ch_reg =~ line
154
158
  result
155
159
  end
156
160
 
157
161
  def handle_modify_line(file, line)
158
162
  result = line
159
- reg = /@"[^"]*[\u4e00-\u9fa5]+[^"]*"/
160
- ma = reg.match(line)
161
- key = find_key_by_cn_val(file, ma[0])
162
- if key
163
- val = format(@modify_format_string, "@\"#{key}\"")
164
- result = line.gsub(ma[0], val)
163
+ line.scan(zh_ch_reg) do |m|
164
+ key = find_key_by_cn_val(file, m)
165
+ if key
166
+ val = format(@modify_format_string, "@\"#{key}\"")
167
+ result = result.gsub(m, val)
168
+ end
165
169
  end
166
170
  result
167
171
  end
@@ -1,5 +1,5 @@
1
1
  module CBin
2
- VERSION = '0.1.6'
2
+ VERSION = '0.1.7'
3
3
  end
4
4
 
5
5
  module Pod
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-aomi-bin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - lihaijian