locca 2.2.2 → 2.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/locca/actions/onesky_sync_action.rb +33 -4
- data/lib/locca/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: 68f0380d8c7822862cb13162d77f1527b82e1b33f5cb814ab5679d62bb0a4456
|
4
|
+
data.tar.gz: debbf9b8e6ec3bb6d1329c372a2094817c7e103d920718ca7e94426c910b5b40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0b3889ef1f12a107b41b53b920533e7a5c815bb872b3c94c3f0db945c684c4b406eeff8d18e327efca8297518311639854085ed985bad65420f32b26cc1291f
|
7
|
+
data.tar.gz: a72af27c5aaa6119f0c204e0aa4052f1caa4182a70014fc2b62620277ac7053dd4740e704b50b6c13c6361b1a14e65b863f063cea64bacb98d124da90e022a39
|
@@ -65,8 +65,22 @@ module Locca
|
|
65
65
|
# 1
|
66
66
|
@generated_collections.each do |generated_collection|
|
67
67
|
@langs.each do |lang|
|
68
|
-
|
69
|
-
|
68
|
+
max_attempts = 3
|
69
|
+
for attempt in 1..max_attempts do
|
70
|
+
print "[*] #{@project.name}: fetch: #{lang}/#{generated_collection.name}\n"
|
71
|
+
begin
|
72
|
+
data = @onesky.fetch_translations(lang, @project.full_collection_name(generated_collection.name))
|
73
|
+
rescue Exception => ex
|
74
|
+
if attempt == max_attempts
|
75
|
+
raise ex
|
76
|
+
end
|
77
|
+
puts "[!] #{ex}"
|
78
|
+
sleep 2
|
79
|
+
else
|
80
|
+
break
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
70
84
|
fetched_collection = @collection_builder.collection_from_datastring(data)
|
71
85
|
|
72
86
|
local_collection_path = @project.path_for_collection(generated_collection.name, lang)
|
@@ -113,9 +127,24 @@ module Locca
|
|
113
127
|
|
114
128
|
# 4
|
115
129
|
@generated_collections.each do |generated_collection|
|
116
|
-
print "[*] #{@project.name}: upload: #{@project.base_lang}/#{generated_collection.name}\n"
|
117
130
|
collection_path = @project.path_for_collection(generated_collection.name, @project.base_lang())
|
118
|
-
|
131
|
+
|
132
|
+
max_attempts = 3
|
133
|
+
for attempt in 1..max_attempts do
|
134
|
+
print "[*] #{@project.name}: upload: #{@project.base_lang}/#{generated_collection.name}\n"
|
135
|
+
begin
|
136
|
+
@onesky.upload_file(collection_path, @project.one_sky_file_format, prune_missing_strings)
|
137
|
+
rescue Exception => ex
|
138
|
+
if attempt == max_attempts
|
139
|
+
raise ex
|
140
|
+
end
|
141
|
+
puts "[!] #{ex}"
|
142
|
+
sleep 2
|
143
|
+
else
|
144
|
+
break
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
119
148
|
end
|
120
149
|
end
|
121
150
|
end
|
data/lib/locca/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: locca
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shurakov Evgeny
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|