ruby-lokalise-api 9.3.0 → 9.4.0

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: 5a734c5288ebac29f39891c5d83af1a5e183232bca6c163d308ea17fa2b40f71
4
- data.tar.gz: cd8cf158d27398557b9b2d24e70a6b3c8cf845e9cc44065d22de24497a69d06a
3
+ metadata.gz: 629370ecc172cb152cfe2341dda5f25f671c6c7ee22694e85109817578bfb556
4
+ data.tar.gz: c7e63178a3e34f5fd4be71ce877d9f8e13060a2faa92fcce02e8863239297af0
5
5
  SHA512:
6
- metadata.gz: 7f005996fb4ee75f9dc7b1b9064897aa3574e3dbf4afc2faad78f9bba09d088c560628ea798f3b8f5acc577596342c06b521bb233d6037c319fd901ca8694733
7
- data.tar.gz: b4327dc17efb6ffa8b05cfad19d63a6eccc652cc0167afd152863509bf5a7a8b415dfc955901b5586a6f020e067096dd4b920b43b7d759209e07e7687e3634f8
6
+ metadata.gz: 8abab50ba6b978a40a2e1f5797052b7cfeb9fb44ad4d4d5ca3265006d1388761a5f5b115d9bc5874a3b45f24117f75556999ce34c082a7789775c3a306cacb87
7
+ data.tar.gz: d1c6236778bd2fe7b82318f6d7fc886479e01d544dc415fad08fa7c06c8b6ee6bf928b56fbe4a103a3d649b87afa4ab7655099a363f3e326986b86f33b58468c
@@ -54,7 +54,7 @@ module RubyLokaliseApi
54
54
  accept: 'application/json',
55
55
  user_agent: "ruby-lokalise-api gem/#{RubyLokaliseApi::VERSION}"
56
56
  },
57
- url: (endpoint.client.api_host || endpoint.base_url)
57
+ url: endpoint.client.api_host || endpoint.base_url
58
58
  }
59
59
  end
60
60
 
@@ -36,6 +36,7 @@ module RubyLokaliseApi
36
36
  delegate_call :files
37
37
  delegate_call :upload_file
38
38
  delegate_call :download_files
39
+ delegate_call :download_files_async
39
40
  delegate_call :destroy_file
40
41
 
41
42
  delegate_call :create_jwt
@@ -50,6 +50,24 @@ module RubyLokaliseApi
50
50
  RubyLokaliseApi::Generics::DownloadBundle.new data.content
51
51
  end
52
52
 
53
+ # Downloads translation files from the project asynchronously
54
+ #
55
+ # @see https://developers.lokalise.com/reference/download-files-async
56
+ # @return [RubyLokaliseApi::Resources::QueuedProcess]
57
+ # @param project_id [String]
58
+ # @param req_params [Hash]
59
+ def download_files_async(project_id, req_params)
60
+ params = { query: [project_id, :'async-download'], req: req_params }
61
+
62
+ response = endpoint(name: 'Files', params: params).do_post
63
+
64
+ process_id = response.content['process_id']
65
+
66
+ response.patch_endpoint_with endpoint(name: 'QueuedProcesses', params: { query: [project_id, process_id] })
67
+
68
+ resource 'QueuedProcess', response
69
+ end
70
+
53
71
  # Deletes a single file from the project.
54
72
  # Only the "Documents" projects are supported
55
73
  #
@@ -6,10 +6,10 @@ module RubyLokaliseApi
6
6
  using RubyLokaliseApi::Utils::Strings
7
7
  using RubyLokaliseApi::Utils::Classes
8
8
 
9
- private
10
-
11
9
  UNIFIED_RESOURCES = %w[comment].freeze
12
10
 
11
+ private
12
+
13
13
  # Loads attributes for the given resource based on its name
14
14
  #
15
15
  # @return [Array<String>]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyLokaliseApi
4
- VERSION = '9.3.0'
4
+ VERSION = '9.4.0'
5
5
  end
@@ -27,6 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.add_dependency 'json', '~> 2'
28
28
  spec.add_dependency 'zeitwerk', '~> 2.4'
29
29
 
30
+ spec.add_development_dependency 'base64', '~> 0.2.0'
30
31
  spec.add_development_dependency 'dotenv', '~> 3.0'
31
32
  spec.add_development_dependency 'oj', '~> 3.10'
32
33
  spec.add_development_dependency 'rake', '~> 13.0'
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-lokalise-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.3.0
4
+ version: 9.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Krukowski
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-11-27 00:00:00.000000000 Z
10
+ date: 2025-02-17 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: addressable
@@ -86,6 +85,20 @@ dependencies:
86
85
  - - "~>"
87
86
  - !ruby/object:Gem::Version
88
87
  version: '2.4'
88
+ - !ruby/object:Gem::Dependency
89
+ name: base64
90
+ requirement: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - "~>"
93
+ - !ruby/object:Gem::Version
94
+ version: 0.2.0
95
+ type: :development
96
+ prerelease: false
97
+ version_requirements: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - "~>"
100
+ - !ruby/object:Gem::Version
101
+ version: 0.2.0
89
102
  - !ruby/object:Gem::Dependency
90
103
  name: dotenv
91
104
  requirement: !ruby/object:Gem::Requirement
@@ -392,7 +405,6 @@ licenses:
392
405
  - BSD-3-Clause
393
406
  metadata:
394
407
  rubygems_mfa_required: 'true'
395
- post_install_message:
396
408
  rdoc_options: []
397
409
  require_paths:
398
410
  - lib
@@ -407,8 +419,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
407
419
  - !ruby/object:Gem::Version
408
420
  version: '0'
409
421
  requirements: []
410
- rubygems_version: 3.5.23
411
- signing_key:
422
+ rubygems_version: 3.6.3
412
423
  specification_version: 4
413
424
  summary: Ruby interface to the Lokalise API
414
425
  test_files: []