lokalise_manager 5.0.0 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/lib/lokalise_manager/task_definitions/base.rb +6 -1
- data/lib/lokalise_manager/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e651c10cfc08624f8bbfe88970210ed7a9e012e8637cc8cbb61aa4328942016b
|
4
|
+
data.tar.gz: f0dea631f1afba287ff49ff7336a1d74030347feafbafb848e8e5f445d466df9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4792e56612597b654536c72b0c29550b15c9e3666da1422208d613e546cb2870b9749a7150111e40296bd5e2550ca9eacedc55715b0c28292eb1cff45eddf9c
|
7
|
+
data.tar.gz: 59cfbc87f48a4293fa064946d638b27510211d05bdd8dd5b9c4c63716455b55cdec851da5b2f35b4a4941d153639874bf87e2e34040cc433fe6a46ce978bc0c8
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 5.1.0 (09-Feb-2024)
|
4
|
+
|
5
|
+
* Handle rare case when the server returns HTML instead of JSON which happens when too many requests are sent
|
6
|
+
|
3
7
|
## 5.0.0 (09-Nov-2023)
|
4
8
|
|
5
9
|
* **Breaking change**: require Ruby 3+. Version 2.7 has reached end-of-life and thus we are not planning to support it anymore. If you need support for Ruby 2.7, please stay on 4.0.0.
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -14,7 +14,7 @@ If you are looking for a Rails integration, please check [lokalise_rails](https:
|
|
14
14
|
|
15
15
|
### Requirements
|
16
16
|
|
17
|
-
This gem requires Ruby
|
17
|
+
This gem requires Ruby 3.0+. You will also need to [setup a Lokalise account](https://app.lokalise.com/signup) and create a [translation project](https://docs.lokalise.com/en/articles/1400460-projects). Finally, you will need to generate a [read/write API token](https://docs.lokalise.com/en/articles/1929556-api-tokens) at your Lokalise profile.
|
18
18
|
|
19
19
|
Alternatively, you can utilize a token obtained via OAuth 2 flow. When using such a token, you'll have to set `:use_oauth2_token` option to `true` (see below).
|
20
20
|
|
@@ -88,6 +88,11 @@ module LokaliseManager
|
|
88
88
|
"#{config.project_id}:#{config.branch}"
|
89
89
|
end
|
90
90
|
|
91
|
+
# In rare cases the server might return HTML instead of JSON.
|
92
|
+
# It happens when too many requests are being sent.
|
93
|
+
# Until this is fixed, we revert to this quick'n'dirty solution.
|
94
|
+
EXCEPTIONS = [JSON::ParserError, RubyLokaliseApi::Error::TooManyRequests].freeze
|
95
|
+
|
91
96
|
# Sends request with exponential backoff mechanism
|
92
97
|
def with_exp_backoff(max_retries)
|
93
98
|
return unless block_given?
|
@@ -95,7 +100,7 @@ module LokaliseManager
|
|
95
100
|
retries = 0
|
96
101
|
begin
|
97
102
|
yield
|
98
|
-
rescue
|
103
|
+
rescue *EXCEPTIONS => e
|
99
104
|
raise(e.class, "Gave up after #{retries} retries") if retries >= max_retries
|
100
105
|
|
101
106
|
sleep 2**retries
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lokalise_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilya Krukowski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-lokalise-api
|
@@ -238,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
238
238
|
- !ruby/object:Gem::Version
|
239
239
|
version: '0'
|
240
240
|
requirements: []
|
241
|
-
rubygems_version: 3.
|
241
|
+
rubygems_version: 3.5.6
|
242
242
|
signing_key:
|
243
243
|
specification_version: 4
|
244
244
|
summary: Lokalise integration for Ruby
|