Class: LokaliseManager::TaskDefinitions::Exporter
- Defined in:
- lib/lokalise_manager/task_definitions/exporter.rb
Overview
Class to handle exporting translation files from a local project to Lokalise.
Constant Summary collapse
- MAX_THREADS =
Maximum number of concurrent uploads to avoid exceeding Lokalise API rate limits.
6
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#export! ⇒ Array
Exports translation files to Lokalise and handles any necessary concurrency and error checking.
Methods inherited from Base
#api_client, #initialize, #reset_api_client!
Constructor Details
This class inherits a constructor from LokaliseManager::TaskDefinitions::Base
Instance Method Details
#export! ⇒ Array
Exports translation files to Lokalise and handles any necessary concurrency and error checking.
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/lokalise_manager/task_definitions/exporter.rb', line 15 def export! queued_processes = all_files.each_slice(MAX_THREADS).flat_map do |files_group| parallel_upload(files_group).tap do |threads| threads.each { |thr| raise_on_fail(thr) if config.raise_on_export_fail } end end unless config.silent_mode queued_processes end |