lokalise_manager 6.1.0 → 6.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b3c30a729a77e6a27fef710604138f0fed6f0f48c019bba7cc3017ba9a70f5a8
4
- data.tar.gz: db85f6500fbbe0e5728c00abb2b51290353b5a6b47a18f160ec2dbaab39a37c5
3
+ metadata.gz: b058f5acea2966c452c6ad194fbc4e82777c4624d58526f2fde8cc1b81ce0f16
4
+ data.tar.gz: 133c9fbd8e7d41ca827719e407ecf40612374c3ef5f39602994d4bbe9fa2ab15
5
5
  SHA512:
6
- metadata.gz: 19a205ecd21020dee1d506e0194be6ca964d0555cb7954d2eeb40ba14ab843870e056fc8e52a7ca306f791398d9e62589f272adc3419040d476e054d7435114d
7
- data.tar.gz: f768da94e78938fabd30a6080e9b0cfa97510b6b07e35598951e5bd85cd831910f859f70abe5efa33473cd3d5f402349a1cadefe3147135a37a947a95edcdfaf
6
+ metadata.gz: 0403ce7ce14ff83d4b2b3e0688350f666a29e6e8d50f4bb224a2c048247f74998569328859e911c2f833d5a7f9d7c1ccba736c94b5c6e2aaf1f4b70c2833c1ca
7
+ data.tar.gz: 6d4dc48b94da3882706c5c30f6600e899b427fce7e5a7c6ea9e192c9c62c2eadbe2d3228c73d8d49b3a3ed6023b6681dac54f2c58c6124aac147a6588267acf9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.1.1 (20-Feb-2025)
4
+
5
+ * Prevent error swallowing in rare cases
6
+
3
7
  ## 6.1.0 (19-Feb-2025)
4
8
 
5
9
  * Added support for `import_async` option (default to `false`). When enabled, the [import process will happen in the background](https://developers.lokalise.com/reference/download-files-async) and the gem will use exponential backoff to wait for its completion according to the `max_retries_import` option.
@@ -9,6 +9,8 @@ module LokaliseManager
9
9
  # Maximum number of concurrent uploads to avoid exceeding Lokalise API rate limits.
10
10
  MAX_THREADS = 6
11
11
 
12
+ ProcessResult = Struct.new(:success, :process, :path, :error, keyword_init: true)
13
+
12
14
  # Exports translation files to Lokalise in batches to optimize performance.
13
15
  #
14
16
  # - Validates configuration.
@@ -49,7 +51,7 @@ module LokaliseManager
49
51
  def raise_on_fail(thread)
50
52
  return if thread.success
51
53
 
52
- raise thread.error.class, "Error while trying to upload #{thread.path}: #{thread.error.message}"
54
+ raise thread.error
53
55
  end
54
56
 
55
57
  # Uploads a single file to Lokalise.
@@ -60,15 +62,13 @@ module LokaliseManager
60
62
  # @param r_path [Pathname] Relative file path within the project.
61
63
  # @return [Struct] Struct containing upload status, process details, and error (if any).
62
64
  def do_upload(f_path, r_path)
63
- proc_klass = Struct.new(:success, :process, :path, :error, keyword_init: true)
64
-
65
65
  process = with_exp_backoff(config.max_retries_export) do
66
66
  api_client.upload_file(project_id_with_branch, opts(f_path, r_path))
67
67
  end
68
68
 
69
- proc_klass.new(success: true, process: process, path: f_path)
69
+ ProcessResult.new(success: true, process: process, path: f_path)
70
70
  rescue StandardError => e
71
- proc_klass.new(success: false, path: f_path, error: e)
71
+ ProcessResult.new(success: false, path: f_path, error: e)
72
72
  end
73
73
 
74
74
  # Prints a message indicating that the export process is complete.
@@ -99,8 +99,6 @@ module LokaliseManager
99
99
  Zip::File.open_buffer(open_file_or_remote(path)) do |zip|
100
100
  zip.each { |entry| process_entry(entry) if proper_ext?(entry.name) }
101
101
  end
102
- rescue StandardError => e
103
- raise e.class, "Error processing ZIP file: #{e.message}"
104
102
  end
105
103
 
106
104
  # Extracts data from a ZIP entry and writes it to the correct directory.
@@ -116,8 +114,6 @@ module LokaliseManager
116
114
  FileUtils.mkdir_p File.dirname(full_path)
117
115
 
118
116
  File.write(full_path, config.translations_converter.call(data), mode: 'w+:UTF-8')
119
- rescue StandardError => e
120
- raise e.class, "Error processing entry #{zip_entry.name}: #{e.message}"
121
117
  end
122
118
 
123
119
  # Checks whether the import should proceed under safe mode constraints.
@@ -157,8 +153,6 @@ module LokaliseManager
157
153
  # @return [Object] The result of the successful operation.
158
154
  def fetch_with_retry(&block)
159
155
  with_exp_backoff(config.max_retries_import, &block)
160
- rescue StandardError => e
161
- raise e.class, "Error during file download: #{e.message}"
162
156
  end
163
157
  end
164
158
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LokaliseManager
4
- VERSION = '6.1.0'
4
+ VERSION = '6.1.1'
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lokalise_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.0
4
+ version: 6.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Krukowski
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-19 00:00:00.000000000 Z
10
+ date: 2025-02-20 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: base64
@@ -250,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
250
250
  - !ruby/object:Gem::Version
251
251
  version: '0'
252
252
  requirements: []
253
- rubygems_version: 3.6.3
253
+ rubygems_version: 3.6.5
254
254
  specification_version: 4
255
255
  summary: Lokalise integration for Ruby
256
256
  test_files: []