lokalise_manager 6.5.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +5 -3
- data/lib/lokalise_manager/error.rb +0 -4
- data/lib/lokalise_manager/global_config.rb +3 -1
- data/lib/lokalise_manager/task_definitions/base.rb +43 -17
- data/lib/lokalise_manager/task_definitions/exporter.rb +10 -10
- data/lib/lokalise_manager/task_definitions/importer.rb +36 -13
- data/lib/lokalise_manager/utils/hash_utils.rb +1 -1
- data/lib/lokalise_manager/version.rb +1 -1
- data/lib/lokalise_manager.rb +2 -3
- data/lokalise_manager.gemspec +11 -9
- metadata +15 -16
- data/.github/CODE_OF_CONDUCT.md +0 -46
- data/.github/CONTRIBUTING.md +0 -14
- data/.github/PULL_REQUEST_TEMPLATE.md +0 -11
- data/Gemfile +0 -5
- data/Rakefile +0 -44
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 47771de487435a3744c042598ce442ecd0e7f1c52080cd2f089974efd6176350
|
|
4
|
+
data.tar.gz: f774cae469107a4816ec6267ec1f4a9201e40ec9f74b26396d8e09c0c4dcbd78
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6a27dd2250f829fc5accad0798504ed18900937bdfec79a1afe046582a381b0c703a6027fb548d98210ef2292096a31beba742e3db814607e9abf935baef31b8
|
|
7
|
+
data.tar.gz: 8f812892db1740c61486f2e16e2579394a51b3f804753aeffecdf6f13a80110de5d8d58a4c7e7730203f0ce02b9f0fd8096a566ceb7cda89344bba7743a8d6fb
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 8.0.0 (26-Feb-2026)
|
|
4
|
+
|
|
5
|
+
* **Require Ruby 3.2+**
|
|
6
|
+
* Various code updates and enhancements
|
|
7
|
+
|
|
8
|
+
## 7.0.0 (26-Feb-2026)
|
|
9
|
+
|
|
10
|
+
* Strengthen config options
|
|
11
|
+
* Various code updates and enhancements
|
|
12
|
+
* Test with Ruby 4
|
|
13
|
+
|
|
3
14
|
## 6.5.0 (01-Aug-2025)
|
|
4
15
|
|
|
5
16
|
* Relaxed rubyzip dependency, allow rubyzip v3
|
data/README.md
CHANGED
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|

|
|
5
|
-
[](https://qlty.sh/gh/bodrovis/projects/lokalise_manager)
|
|
6
|
+
[](https://qlty.sh/gh/bodrovis/projects/lokalise_manager)
|
|
7
7
|

|
|
8
8
|
|
|
9
9
|
The LokaliseManager gem provides seamless integration with [Lokalise](http://lokalise.com), enabling easy exchange of translation files between your Ruby project and the Lokalise translation management system (TMS). It leverages the [ruby-lokalise-api](https://lokalise.github.io/ruby-lokalise-api) to send and manage APIv2 requests.
|
|
10
10
|
|
|
11
11
|
For integration directly with Rails applications, refer to [lokalise_rails](https://github.com/bodrovis/lokalise_rails), which offers a suite of Rake tasks specifically designed for importing and exporting translation files.
|
|
12
12
|
|
|
13
|
+
> Find demo scripts showcasing lokalise_manager usage in the [lokalise_manager_demo repo](https://github.com/bodrovis/lokalise_manager_demo).
|
|
14
|
+
|
|
13
15
|
## Getting Started
|
|
14
16
|
|
|
15
17
|
### Requirements
|
|
@@ -190,7 +192,7 @@ c.export_preprocessor = ->(raw_data, _path) { raw_data.upcase }
|
|
|
190
192
|
c.export_filename_generator = ->(_full_path, relative_path) { relative_path.to_s.upcase }
|
|
191
193
|
```
|
|
192
194
|
|
|
193
|
-
* `max_retries_export` (`integer`) —
|
|
195
|
+
* `max_retries_export` (`integer`) — controls how many times LokaliseManager retries an export when the Lokalise API returns HTTP status `429` (Too Many Requests) or when a temporary response parsing error occurs. Retries use exponential backoff based on `2 ** retries`, with a small random jitter added to each delay. If the maximum number of retries is reached, the original exception is raised and the export operation is halted. By default, LokaliseManager performs up to `5` retries, resulting in base delays of `1 + 2 + 4 + 8 + 16 = 31` seconds in total, plus up to approximately `5` seconds of additional jitter. If `max_retries_export` is less than `1`, LokaliseManager does not retry and gives up immediately after the first failure.
|
|
194
196
|
* `raise_on_export_fail` (`boolean`) — default is `true`. When this option is enabled, LokaliseManager will re-raise any exceptions that happened during the file uploading. In other words, if any uploading thread raised an exception, your exporting process will exit with an exception. Suppose, you are uploading 12 translation files; these files will be split in 2 groups with 6 files each, and each group will be uploaded in parallel (using threads). However, suppose some exception happens when uploading the first group. By default this exception will be re-raised for the whole process and the script will never try to upload the second group. If you would like to continue uploading even if an exception happened, set the `raise_on_export_fail` to `false`. In this case the `export!` method will return an array with scheduled processes and with information about processes that were not successfully scheduled. This information is represented as an object with three methods: `path` (contains an instance of the `Pathname` class which says which file could not be uploaded), `error` (the actual exception), and `success` (returns `false`). So, you can use the following snippet to check your processes:
|
|
195
197
|
|
|
196
198
|
```ruby
|
|
@@ -5,9 +5,5 @@ module LokaliseManager
|
|
|
5
5
|
# allowing the library to raise specific errors that can be easily identified
|
|
6
6
|
# and handled separately from other StandardError exceptions in Ruby.
|
|
7
7
|
class Error < StandardError
|
|
8
|
-
# Initializes a new Error object
|
|
9
|
-
def initialize(message = '')
|
|
10
|
-
super
|
|
11
|
-
end
|
|
12
8
|
end
|
|
13
9
|
end
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require 'yaml'
|
|
4
|
+
|
|
3
5
|
module LokaliseManager
|
|
4
6
|
# GlobalConfig provides a central place to manage configuration settings for LokaliseManager.
|
|
5
7
|
# It allows setting various operational parameters such as API tokens, paths, and behavior modifiers.
|
|
@@ -34,7 +36,7 @@ module LokaliseManager
|
|
|
34
36
|
|
|
35
37
|
# Return the path to locales
|
|
36
38
|
def locales_path
|
|
37
|
-
@locales_path ||
|
|
39
|
+
@locales_path || File.join(Dir.pwd, 'locales')
|
|
38
40
|
end
|
|
39
41
|
|
|
40
42
|
# Return the project branch
|
|
@@ -23,6 +23,18 @@ module LokaliseManager
|
|
|
23
23
|
# - `RubyLokaliseApi::Error::TooManyRequests`: Raised when too many requests are sent in a short period.
|
|
24
24
|
EXCEPTIONS = [JSON::ParserError, RubyLokaliseApi::Error::TooManyRequests].freeze
|
|
25
25
|
|
|
26
|
+
# All configuration-related keys
|
|
27
|
+
CONFIG_KEYS = %i[
|
|
28
|
+
api_token project_id import_opts import_safe_mode export_opts locales_path file_ext_regexp
|
|
29
|
+
skip_file_export branch additional_client_opts translations_loader translations_converter
|
|
30
|
+
lang_iso_inferer max_retries_export max_retries_import use_oauth2_token silent_mode
|
|
31
|
+
raise_on_export_fail import_async export_preprocessor export_filename_generator
|
|
32
|
+
].freeze
|
|
33
|
+
|
|
34
|
+
BACKOFF_BASE_SECONDS = 1 # base multiplier (1,2,4,8...)
|
|
35
|
+
BACKOFF_CAP_SECONDS = 32 # max exponential backoff before jitter
|
|
36
|
+
BACKOFF_JITTER_RANGE = 1.0 # adds rand * range
|
|
37
|
+
|
|
26
38
|
# Initializes a new task object with merged global and custom configurations.
|
|
27
39
|
#
|
|
28
40
|
# @param custom_opts [Hash] Custom configuration options specific to the task.
|
|
@@ -69,13 +81,12 @@ module LokaliseManager
|
|
|
69
81
|
# @param custom_opts [Hash] The custom configuration options.
|
|
70
82
|
# @return [Hash] The merged configuration.
|
|
71
83
|
def merge_configs(global_config, custom_opts)
|
|
72
|
-
primary_opts = global_config
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
end
|
|
84
|
+
primary_opts = CONFIG_KEYS.to_h { |k| [k, global_config.public_send(k)] }
|
|
85
|
+
|
|
86
|
+
custom_opts = custom_opts.transform_keys(&:to_sym)
|
|
87
|
+
|
|
88
|
+
unknown = custom_opts.keys - CONFIG_KEYS
|
|
89
|
+
raise LokaliseManager::Error, "Unknown config keys: #{unknown.join(', ')}" if unknown.any?
|
|
79
90
|
|
|
80
91
|
primary_opts.deep_merge(custom_opts)
|
|
81
92
|
end
|
|
@@ -109,14 +120,6 @@ module LokaliseManager
|
|
|
109
120
|
config.file_ext_regexp.match? path.extname
|
|
110
121
|
end
|
|
111
122
|
|
|
112
|
-
# Extracts the subdirectory and filename from a given path.
|
|
113
|
-
#
|
|
114
|
-
# @param entry [String] The file path.
|
|
115
|
-
# @return [Array<Pathname, Pathname>] An array containing the subdirectory and filename.
|
|
116
|
-
def subdir_and_filename_for(entry)
|
|
117
|
-
Pathname.new(entry).split
|
|
118
|
-
end
|
|
119
|
-
|
|
120
123
|
# Constructs a Lokalise project identifier that may include a branch.
|
|
121
124
|
#
|
|
122
125
|
# If a branch is specified, the project ID is formatted as `project_id:branch`.
|
|
@@ -136,17 +139,40 @@ module LokaliseManager
|
|
|
136
139
|
def with_exp_backoff(max_retries)
|
|
137
140
|
return unless block_given?
|
|
138
141
|
|
|
142
|
+
max_retries = max_retries.to_i
|
|
143
|
+
max_retries = 0 if max_retries.negative?
|
|
144
|
+
|
|
139
145
|
retries = 0
|
|
146
|
+
|
|
140
147
|
begin
|
|
141
148
|
yield
|
|
142
149
|
rescue *EXCEPTIONS => e
|
|
143
|
-
|
|
150
|
+
raise_on_max_retries(retries, max_retries, e)
|
|
151
|
+
|
|
152
|
+
sleep_with_backoff(retries)
|
|
144
153
|
|
|
145
|
-
sleep 2**retries
|
|
146
154
|
retries += 1
|
|
147
155
|
retry
|
|
148
156
|
end
|
|
149
157
|
end
|
|
158
|
+
|
|
159
|
+
def sleep_with_backoff(retries)
|
|
160
|
+
base_sleep = BACKOFF_BASE_SECONDS.to_f * (2**retries)
|
|
161
|
+
capped = [base_sleep, BACKOFF_CAP_SECONDS.to_f].min
|
|
162
|
+
jitter = BACKOFF_JITTER_RANGE.to_f <= 0 ? 0.0 : rand * BACKOFF_JITTER_RANGE.to_f
|
|
163
|
+
sleep(capped + jitter)
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
def raise_on_max_retries(retries, max_retries, error)
|
|
167
|
+
# We already failed (retries+1) times total including this one.
|
|
168
|
+
return unless retries >= max_retries
|
|
169
|
+
|
|
170
|
+
# Preserve original exception class + backtrace, but add context.
|
|
171
|
+
attempts = retries + 1
|
|
172
|
+
raise error.class,
|
|
173
|
+
"Gave up after #{retries} retries (#{attempts} attempts). Last error: #{error.class}: #{error.message}",
|
|
174
|
+
error.backtrace
|
|
175
|
+
end
|
|
150
176
|
end
|
|
151
177
|
end
|
|
152
178
|
end
|
|
@@ -6,7 +6,7 @@ module LokaliseManager
|
|
|
6
6
|
module TaskDefinitions
|
|
7
7
|
# Handles exporting translation files from a local project to Lokalise.
|
|
8
8
|
class Exporter < Base
|
|
9
|
-
#
|
|
9
|
+
# Number of files uploaded concurrently in each batch.
|
|
10
10
|
MAX_THREADS = 6
|
|
11
11
|
|
|
12
12
|
ProcessResult = Struct.new(:success, :process, :path, :error, keyword_init: true)
|
|
@@ -15,7 +15,7 @@ module LokaliseManager
|
|
|
15
15
|
#
|
|
16
16
|
# - Validates configuration.
|
|
17
17
|
# - Gathers translation files from the project directory.
|
|
18
|
-
# - Uploads files to Lokalise in parallel
|
|
18
|
+
# - Uploads files to Lokalise in parallel and retries rate-limited requests.
|
|
19
19
|
# - Handles errors and ensures failed uploads are reported.
|
|
20
20
|
#
|
|
21
21
|
# @return [Array] An array of process results for each uploaded file.
|
|
@@ -23,8 +23,8 @@ module LokaliseManager
|
|
|
23
23
|
check_options_errors!
|
|
24
24
|
|
|
25
25
|
queued_processes = all_files.each_slice(MAX_THREADS).flat_map do |files_group|
|
|
26
|
-
parallel_upload(files_group).tap do |
|
|
27
|
-
|
|
26
|
+
parallel_upload(files_group).tap do |results|
|
|
27
|
+
results.each { |result| raise_on_fail(result) if config.raise_on_export_fail }
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
30
|
|
|
@@ -45,13 +45,13 @@ module LokaliseManager
|
|
|
45
45
|
end.map(&:value)
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
-
# Raises an error if a file upload
|
|
48
|
+
# Raises an error if a file upload result failed.
|
|
49
49
|
#
|
|
50
|
-
# @param
|
|
51
|
-
def raise_on_fail(
|
|
52
|
-
return if
|
|
50
|
+
# @param result [Struct] The result of the file upload thread.
|
|
51
|
+
def raise_on_fail(result)
|
|
52
|
+
return if result.success
|
|
53
53
|
|
|
54
|
-
raise
|
|
54
|
+
raise result.error
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
# Uploads a single file to Lokalise.
|
|
@@ -99,7 +99,7 @@ module LokaliseManager
|
|
|
99
99
|
# @param relative_path [Pathname] Relative path within the project.
|
|
100
100
|
# @return [Hash] Upload options including encoded content, filename, and language.
|
|
101
101
|
def opts(full_path, relative_path)
|
|
102
|
-
content = File.read(full_path)
|
|
102
|
+
content = File.read(full_path, mode: 'r:UTF-8')
|
|
103
103
|
|
|
104
104
|
{
|
|
105
105
|
data: Base64.strict_encode64(config.export_preprocessor.call(content, full_path)),
|
|
@@ -71,14 +71,17 @@ module LokaliseManager
|
|
|
71
71
|
# @return [QueuedProcess] The process object when completed successfully.
|
|
72
72
|
# @raise [LokaliseManager::Error] If the process fails or takes too long.
|
|
73
73
|
def wait_for_async_download(process_id)
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
max_retries = [config.max_retries_import.to_i, 0].max
|
|
75
|
+
|
|
76
|
+
(max_retries + 1).times do |i|
|
|
76
77
|
process = reload_process(process_id)
|
|
77
78
|
|
|
78
79
|
case process.status
|
|
79
80
|
when 'failed' then raise LokaliseManager::Error, 'Asynchronous download process failed'
|
|
80
81
|
when 'finished' then return process
|
|
81
82
|
end
|
|
83
|
+
|
|
84
|
+
sleep_with_backoff(i) if i < max_retries
|
|
82
85
|
end
|
|
83
86
|
|
|
84
87
|
raise LokaliseManager::Error, "Asynchronous download process timed out after #{config.max_retries_import} tries"
|
|
@@ -89,16 +92,21 @@ module LokaliseManager
|
|
|
89
92
|
# @param process_id [String] The process ID to check.
|
|
90
93
|
# @return [QueuedProcess] The process object with updated status.
|
|
91
94
|
def reload_process(process_id)
|
|
92
|
-
|
|
95
|
+
fetch_with_retry do
|
|
96
|
+
api_client.queued_process(project_id_with_branch, process_id)
|
|
97
|
+
end
|
|
93
98
|
end
|
|
94
99
|
|
|
95
100
|
# Extracts and processes files from a ZIP archive.
|
|
96
101
|
#
|
|
97
102
|
# @param path [String] The URL or local path to the ZIP archive.
|
|
98
103
|
def open_and_process_zip(path)
|
|
99
|
-
|
|
104
|
+
io = open_file_or_remote(path)
|
|
105
|
+
Zip::File.open_buffer(io) do |zip|
|
|
100
106
|
zip.each { |entry| process_entry(entry) if proper_ext?(entry.name) }
|
|
101
107
|
end
|
|
108
|
+
ensure
|
|
109
|
+
io.close if io && !io.closed?
|
|
102
110
|
end
|
|
103
111
|
|
|
104
112
|
# Extracts data from a ZIP entry and writes it to the correct directory.
|
|
@@ -110,10 +118,22 @@ module LokaliseManager
|
|
|
110
118
|
# @param zip_entry [Zip::Entry] The ZIP entry to process.
|
|
111
119
|
def process_entry(zip_entry)
|
|
112
120
|
data = data_from(zip_entry)
|
|
113
|
-
|
|
114
|
-
|
|
121
|
+
dest = safe_dest_path(zip_entry.name)
|
|
122
|
+
return unless dest
|
|
123
|
+
|
|
124
|
+
FileUtils.mkdir_p(dest.dirname)
|
|
125
|
+
File.write(dest, config.translations_converter.call(data), mode: 'w:UTF-8')
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
def safe_dest_path(entry_name)
|
|
129
|
+
base = Pathname.new(config.locales_path).expand_path
|
|
130
|
+
normalized = entry_name.tr('\\', '/')
|
|
131
|
+
dest = base.join(normalized).cleanpath
|
|
132
|
+
base_s = base.to_s
|
|
133
|
+
dest_s = dest.to_s
|
|
134
|
+
return nil unless dest_s == base_s || dest_s.start_with?(base_s + File::SEPARATOR)
|
|
115
135
|
|
|
116
|
-
|
|
136
|
+
dest
|
|
117
137
|
end
|
|
118
138
|
|
|
119
139
|
# Checks whether the import should proceed under safe mode constraints.
|
|
@@ -123,11 +143,14 @@ module LokaliseManager
|
|
|
123
143
|
#
|
|
124
144
|
# @return [Boolean] `true` if the import should proceed, `false` otherwise.
|
|
125
145
|
def proceed_when_safe_mode?
|
|
126
|
-
|
|
146
|
+
path = config.locales_path.to_s
|
|
147
|
+
return true unless config.import_safe_mode
|
|
148
|
+
return true unless Dir.exist?(path)
|
|
149
|
+
return true if Dir.empty?(path)
|
|
127
150
|
|
|
128
|
-
$stdout.puts "The target directory #{
|
|
151
|
+
$stdout.puts "The target directory #{path} is not empty!"
|
|
129
152
|
$stdout.print 'Enter Y to continue: '
|
|
130
|
-
$stdin.gets
|
|
153
|
+
$stdin.gets&.strip&.upcase == 'Y'
|
|
131
154
|
end
|
|
132
155
|
|
|
133
156
|
# Opens a local file or downloads a remote file.
|
|
@@ -136,7 +159,7 @@ module LokaliseManager
|
|
|
136
159
|
# @return [IO] An IO object for reading the file.
|
|
137
160
|
def open_file_or_remote(path)
|
|
138
161
|
uri = URI.parse(path)
|
|
139
|
-
uri.scheme&.start_with?('http') ? uri.open : File.open(path)
|
|
162
|
+
uri.scheme&.start_with?('http') ? uri.open(open_timeout: 10, read_timeout: 60) : File.open(path)
|
|
140
163
|
end
|
|
141
164
|
|
|
142
165
|
# Reads and processes data from a ZIP file entry.
|
|
@@ -151,8 +174,8 @@ module LokaliseManager
|
|
|
151
174
|
#
|
|
152
175
|
# @yield The operation to retry.
|
|
153
176
|
# @return [Object] The result of the successful operation.
|
|
154
|
-
def fetch_with_retry(&
|
|
155
|
-
with_exp_backoff(config.max_retries_import, &
|
|
177
|
+
def fetch_with_retry(&)
|
|
178
|
+
with_exp_backoff(config.max_retries_import, &)
|
|
156
179
|
end
|
|
157
180
|
end
|
|
158
181
|
end
|
|
@@ -6,7 +6,7 @@ module LokaliseManager
|
|
|
6
6
|
module HashUtils
|
|
7
7
|
refine Hash do
|
|
8
8
|
# Deeply merges two hashes
|
|
9
|
-
# Taken from https://
|
|
9
|
+
# Taken from https://api.rubyonrails.org/files/activesupport/lib/active_support/core_ext/hash/deep_merge_rb.html
|
|
10
10
|
def deep_merge(other_hash, &block)
|
|
11
11
|
dup.deep_merge!(other_hash, &block)
|
|
12
12
|
end
|
data/lib/lokalise_manager.rb
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require 'zeitwerk'
|
|
4
|
-
require 'yaml'
|
|
5
4
|
|
|
6
5
|
loader = Zeitwerk::Loader.for_gem
|
|
7
6
|
loader.setup
|
|
@@ -38,7 +37,7 @@ module LokaliseManager
|
|
|
38
37
|
# ```
|
|
39
38
|
#
|
|
40
39
|
def importer(custom_opts = {}, global_config = LokaliseManager::GlobalConfig)
|
|
41
|
-
|
|
40
|
+
TaskDefinitions::Importer.new custom_opts, global_config
|
|
42
41
|
end
|
|
43
42
|
|
|
44
43
|
# Instantiates an exporter for uploading translation files to Lokalise.
|
|
@@ -54,7 +53,7 @@ module LokaliseManager
|
|
|
54
53
|
# ```
|
|
55
54
|
#
|
|
56
55
|
def exporter(custom_opts = {}, global_config = LokaliseManager::GlobalConfig)
|
|
57
|
-
|
|
56
|
+
TaskDefinitions::Exporter.new custom_opts, global_config
|
|
58
57
|
end
|
|
59
58
|
end
|
|
60
59
|
end
|
data/lokalise_manager.gemspec
CHANGED
|
@@ -13,31 +13,33 @@ Gem::Specification.new do |spec|
|
|
|
13
13
|
spec.homepage = 'https://github.com/bodrovis/lokalise_manager'
|
|
14
14
|
spec.license = 'MIT'
|
|
15
15
|
spec.platform = Gem::Platform::RUBY
|
|
16
|
-
spec.required_ruby_version = '>= 3.
|
|
16
|
+
spec.required_ruby_version = '>= 3.2'
|
|
17
17
|
|
|
18
18
|
spec.files = Dir['README.md', 'LICENSE',
|
|
19
19
|
'CHANGELOG.md', 'lib/**/*.rb',
|
|
20
|
-
'
|
|
21
|
-
'lokalise_manager.gemspec', '.github/*.md',
|
|
22
|
-
'Gemfile', 'Rakefile']
|
|
20
|
+
'lokalise_manager.gemspec']
|
|
23
21
|
spec.extra_rdoc_files = ['README.md']
|
|
24
22
|
spec.require_paths = ['lib']
|
|
25
23
|
|
|
26
24
|
spec.add_dependency 'base64', '~> 0.3.0'
|
|
27
|
-
spec.add_dependency 'ruby-lokalise-api', '~>
|
|
25
|
+
spec.add_dependency 'ruby-lokalise-api', '~> 10.0'
|
|
28
26
|
spec.add_dependency 'rubyzip', '>= 2.3', '< 4.0'
|
|
29
27
|
spec.add_dependency 'zeitwerk', '~> 2.4'
|
|
30
28
|
|
|
31
29
|
spec.add_development_dependency 'dotenv', '~> 3.0'
|
|
32
30
|
spec.add_development_dependency 'rake', '~> 13.0'
|
|
33
|
-
spec.add_development_dependency 'rspec', '~> 3.
|
|
31
|
+
spec.add_development_dependency 'rspec', '~> 3.13'
|
|
34
32
|
spec.add_development_dependency 'rubocop', '~> 1.0'
|
|
35
33
|
spec.add_development_dependency 'rubocop-performance', '~> 1.5'
|
|
36
|
-
spec.add_development_dependency 'rubocop-rake', '~> 0.
|
|
34
|
+
spec.add_development_dependency 'rubocop-rake', '~> 0.7'
|
|
37
35
|
spec.add_development_dependency 'rubocop-rspec', '~> 3.0'
|
|
38
|
-
spec.add_development_dependency 'simplecov', '~> 0
|
|
36
|
+
spec.add_development_dependency 'simplecov', '~> 1.0'
|
|
39
37
|
spec.add_development_dependency 'webmock', '~> 3.18'
|
|
40
38
|
spec.metadata = {
|
|
41
|
-
'rubygems_mfa_required' => 'true'
|
|
39
|
+
'rubygems_mfa_required' => 'true',
|
|
40
|
+
'bug_tracker_uri' => 'https://github.com/bodrovis/lokalise_manager/issues',
|
|
41
|
+
'changelog_uri' => 'https://github.com/bodrovis/lokalise_manager/blob/master/CHANGELOG.md',
|
|
42
|
+
'documentation_uri' => 'https://github.com/bodrovis/lokalise_manager/blob/master/README.md',
|
|
43
|
+
'homepage_uri' => spec.homepage
|
|
42
44
|
}
|
|
43
45
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lokalise_manager
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 8.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ilya Krukowski
|
|
@@ -29,14 +29,14 @@ dependencies:
|
|
|
29
29
|
requirements:
|
|
30
30
|
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '
|
|
32
|
+
version: '10.0'
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '
|
|
39
|
+
version: '10.0'
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: rubyzip
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -105,14 +105,14 @@ dependencies:
|
|
|
105
105
|
requirements:
|
|
106
106
|
- - "~>"
|
|
107
107
|
- !ruby/object:Gem::Version
|
|
108
|
-
version: '3.
|
|
108
|
+
version: '3.13'
|
|
109
109
|
type: :development
|
|
110
110
|
prerelease: false
|
|
111
111
|
version_requirements: !ruby/object:Gem::Requirement
|
|
112
112
|
requirements:
|
|
113
113
|
- - "~>"
|
|
114
114
|
- !ruby/object:Gem::Version
|
|
115
|
-
version: '3.
|
|
115
|
+
version: '3.13'
|
|
116
116
|
- !ruby/object:Gem::Dependency
|
|
117
117
|
name: rubocop
|
|
118
118
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -147,14 +147,14 @@ dependencies:
|
|
|
147
147
|
requirements:
|
|
148
148
|
- - "~>"
|
|
149
149
|
- !ruby/object:Gem::Version
|
|
150
|
-
version: '0.
|
|
150
|
+
version: '0.7'
|
|
151
151
|
type: :development
|
|
152
152
|
prerelease: false
|
|
153
153
|
version_requirements: !ruby/object:Gem::Requirement
|
|
154
154
|
requirements:
|
|
155
155
|
- - "~>"
|
|
156
156
|
- !ruby/object:Gem::Version
|
|
157
|
-
version: '0.
|
|
157
|
+
version: '0.7'
|
|
158
158
|
- !ruby/object:Gem::Dependency
|
|
159
159
|
name: rubocop-rspec
|
|
160
160
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -175,14 +175,14 @@ dependencies:
|
|
|
175
175
|
requirements:
|
|
176
176
|
- - "~>"
|
|
177
177
|
- !ruby/object:Gem::Version
|
|
178
|
-
version: '0
|
|
178
|
+
version: '1.0'
|
|
179
179
|
type: :development
|
|
180
180
|
prerelease: false
|
|
181
181
|
version_requirements: !ruby/object:Gem::Requirement
|
|
182
182
|
requirements:
|
|
183
183
|
- - "~>"
|
|
184
184
|
- !ruby/object:Gem::Version
|
|
185
|
-
version: '0
|
|
185
|
+
version: '1.0'
|
|
186
186
|
- !ruby/object:Gem::Dependency
|
|
187
187
|
name: webmock
|
|
188
188
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -206,14 +206,9 @@ extensions: []
|
|
|
206
206
|
extra_rdoc_files:
|
|
207
207
|
- README.md
|
|
208
208
|
files:
|
|
209
|
-
- ".github/CODE_OF_CONDUCT.md"
|
|
210
|
-
- ".github/CONTRIBUTING.md"
|
|
211
|
-
- ".github/PULL_REQUEST_TEMPLATE.md"
|
|
212
209
|
- CHANGELOG.md
|
|
213
|
-
- Gemfile
|
|
214
210
|
- LICENSE
|
|
215
211
|
- README.md
|
|
216
|
-
- Rakefile
|
|
217
212
|
- lib/lokalise_manager.rb
|
|
218
213
|
- lib/lokalise_manager/error.rb
|
|
219
214
|
- lib/lokalise_manager/global_config.rb
|
|
@@ -228,6 +223,10 @@ licenses:
|
|
|
228
223
|
- MIT
|
|
229
224
|
metadata:
|
|
230
225
|
rubygems_mfa_required: 'true'
|
|
226
|
+
bug_tracker_uri: https://github.com/bodrovis/lokalise_manager/issues
|
|
227
|
+
changelog_uri: https://github.com/bodrovis/lokalise_manager/blob/master/CHANGELOG.md
|
|
228
|
+
documentation_uri: https://github.com/bodrovis/lokalise_manager/blob/master/README.md
|
|
229
|
+
homepage_uri: https://github.com/bodrovis/lokalise_manager
|
|
231
230
|
rdoc_options: []
|
|
232
231
|
require_paths:
|
|
233
232
|
- lib
|
|
@@ -235,14 +234,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
235
234
|
requirements:
|
|
236
235
|
- - ">="
|
|
237
236
|
- !ruby/object:Gem::Version
|
|
238
|
-
version: '3.
|
|
237
|
+
version: '3.2'
|
|
239
238
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
240
239
|
requirements:
|
|
241
240
|
- - ">="
|
|
242
241
|
- !ruby/object:Gem::Version
|
|
243
242
|
version: '0'
|
|
244
243
|
requirements: []
|
|
245
|
-
rubygems_version:
|
|
244
|
+
rubygems_version: 4.0.19
|
|
246
245
|
specification_version: 4
|
|
247
246
|
summary: Lokalise integration for Ruby
|
|
248
247
|
test_files: []
|
data/.github/CODE_OF_CONDUCT.md
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
|
2
|
-
|
|
3
|
-
## Our Pledge
|
|
4
|
-
|
|
5
|
-
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
|
6
|
-
|
|
7
|
-
## Our Standards
|
|
8
|
-
|
|
9
|
-
Examples of behavior that contributes to creating a positive environment include:
|
|
10
|
-
|
|
11
|
-
* Using welcoming and inclusive language
|
|
12
|
-
* Being respectful of differing viewpoints and experiences
|
|
13
|
-
* Gracefully accepting constructive criticism
|
|
14
|
-
* Focusing on what is best for the community
|
|
15
|
-
* Showing empathy towards other community members
|
|
16
|
-
|
|
17
|
-
Examples of unacceptable behavior by participants include:
|
|
18
|
-
|
|
19
|
-
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
|
20
|
-
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
21
|
-
* Public or private harassment
|
|
22
|
-
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
|
23
|
-
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
24
|
-
|
|
25
|
-
## Our Responsibilities
|
|
26
|
-
|
|
27
|
-
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
|
28
|
-
|
|
29
|
-
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
|
30
|
-
|
|
31
|
-
## Scope
|
|
32
|
-
|
|
33
|
-
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
|
34
|
-
|
|
35
|
-
## Enforcement
|
|
36
|
-
|
|
37
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at hello@lokalise.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
|
38
|
-
|
|
39
|
-
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
|
40
|
-
|
|
41
|
-
## Attribution
|
|
42
|
-
|
|
43
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
|
44
|
-
|
|
45
|
-
[homepage]: http://contributor-covenant.org
|
|
46
|
-
[version]: http://contributor-covenant.org/version/1/4/
|
data/.github/CONTRIBUTING.md
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# Contributing
|
|
2
|
-
|
|
3
|
-
1. [Fork the repository.][fork]
|
|
4
|
-
2. [Create a topic branch.][branch]
|
|
5
|
-
3. Implement your feature or bug fix.
|
|
6
|
-
4. Don't forget to add specs and make sure they pass by running `rspec .`.
|
|
7
|
-
5. Make sure your code complies with the style guide by running `rubocop`. `rubocop -a` can automatically fix most issues for you.
|
|
8
|
-
6. If necessary, add documentation for your feature or bug fix.
|
|
9
|
-
7. Commit and push your changes.
|
|
10
|
-
8. [Submit a pull request.][pr]
|
|
11
|
-
|
|
12
|
-
[fork]: http://help.github.com/fork-a-repo/
|
|
13
|
-
[branch]: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-branches
|
|
14
|
-
[pr]: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
### Summary
|
|
2
|
-
|
|
3
|
-
Provide a general description of the code changes in your pull
|
|
4
|
-
request. Were there any bugs you had fixed? If so, mention them. If
|
|
5
|
-
these bugs have open GitHub issues, be sure to tag them here as well,
|
|
6
|
-
to keep the conversation linked together.
|
|
7
|
-
|
|
8
|
-
### Other Information
|
|
9
|
-
|
|
10
|
-
If there's anything else that's important and relevant to your pull
|
|
11
|
-
request, mention that information here.
|
data/Gemfile
DELETED
data/Rakefile
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'rake'
|
|
4
|
-
require 'rake/clean'
|
|
5
|
-
require 'rspec/core/rake_task'
|
|
6
|
-
require 'rubocop/rake_task'
|
|
7
|
-
|
|
8
|
-
begin
|
|
9
|
-
require 'bundler/setup'
|
|
10
|
-
Bundler::GemHelper.install_tasks
|
|
11
|
-
rescue LoadError
|
|
12
|
-
puts 'although not required, bundler is recommened for running the tests'
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
RSpec::Core::RakeTask.new(:spec)
|
|
16
|
-
|
|
17
|
-
RuboCop::RakeTask.new do |task|
|
|
18
|
-
task.requires << 'rubocop-performance'
|
|
19
|
-
task.requires << 'rubocop-rspec'
|
|
20
|
-
task.requires << 'rubocop-rake'
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
CLOBBER.include(FileList['./*.gem'])
|
|
24
|
-
|
|
25
|
-
namespace :lokalise do
|
|
26
|
-
desc 'Updates RubyGems, installs dependencies'
|
|
27
|
-
task :install do
|
|
28
|
-
puts 'Running bundle install'
|
|
29
|
-
sh 'gem update --system'
|
|
30
|
-
sh 'bundle'
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
desc 'Builds the gem'
|
|
34
|
-
task :build do
|
|
35
|
-
puts 'Building'
|
|
36
|
-
sh 'gem build lokalise_manager.gemspec'
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
task rubospec: %w[rubocop spec]
|
|
41
|
-
|
|
42
|
-
task full_build: %w[clobber lokalise:install lokalise:build]
|
|
43
|
-
|
|
44
|
-
task default: :full_build
|