lokalise_manager 6.4.0 → 7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3d449c0a476650e30e126c7b468b8265e8afc17819ea4223a7a1a2a2228e70c
4
- data.tar.gz: d5a4eb4621151d3003c6df65b4c404929cff3512964bff3a0628594b568fc68a
3
+ metadata.gz: 2f26d5ce781a9d86514c586bfed53b81bda6b5c9016f4277933b02fc74f6ccac
4
+ data.tar.gz: 9f41116d698fc3c5bda485f414488d6e2ff89820d560204322e2e5349b69eb03
5
5
  SHA512:
6
- metadata.gz: 88fa1d12483670f848b83e3391304ec4f0186ca6fd75b67cd6c9a52de6182cd579701fa69434ae60bb5587e6cfd80c39507346468a5ee4b66c2efb9064804098
7
- data.tar.gz: 860a18bfc113b64899d5f4acc1ca94435093cd66a07a0dffa40073009085d176f6a196c0e2267d3bda0dd9e3dc5b3085115f0bbf66506dcf1994a8c040b7394a
6
+ metadata.gz: 7366a212d37275abcb38970ddc20dcd913ba482acdcd07cb6b5e7aa1f40e4082f3ddbead4ec4cf9dbd663aa88e9f6daa78132dad00e4c2e7f35681091179439c
7
+ data.tar.gz: 8e9e04bbe474d0407a41f07580f8405c1ead322c2bf948df2c6cd3db1661eb4e9875b8ca372e051134c32d944c749fb90f91bb93d66d2d19ae83f1197f4e90b0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 7.0.0 (26-Feb-2026)
4
+
5
+ * Strengthen config options
6
+ * Various code updates and enhancements
7
+ * Test with Ruby 4
8
+
9
+ ## 6.5.0 (01-Aug-2025)
10
+
11
+ * Relaxed rubyzip dependency, allow rubyzip v3
12
+ * Test with Ruby 3.5
13
+
3
14
  ## 6.4.0 (04-Jul-2025)
4
15
 
5
16
  * Added a new export option `export_filename_generator` (`lambda` or `proc`) that allows to control the `filename` sent to Lokalise for each uploaded file. The lambda takes two arguments: full file path and relative path (both `Pathname` instances). The relative path is calculated based on your `locales_path` setting — it shows the file's location inside your locales folder. The lambda must return a string or `Pathname` (or anything convertible to string) with the desired filename. By default, the relative path is used as the filename.
data/README.md CHANGED
@@ -2,14 +2,16 @@
2
2
 
3
3
  ![Gem](https://img.shields.io/gem/v/lokalise_manager)
4
4
  ![CI](https://github.com/bodrovis/lokalise_manager/actions/workflows/ci.yml/badge.svg)
5
- [![Code Coverage](https://qlty.sh/badges/3c228b9b-c8b2-4a74-9619-f21fc79b8e83/test_coverage.svg)](https://qlty.sh/gh/bodrovis/projects/lokalise_manager)
6
- [![Maintainability](https://qlty.sh/badges/3c228b9b-c8b2-4a74-9619-f21fc79b8e83/maintainability.svg)](https://qlty.sh/gh/bodrovis/projects/lokalise_manager)
5
+ [![Code Coverage](https://qlty.sh/gh/bodrovis/projects/lokalise_manager/coverage.svg)](https://qlty.sh/gh/bodrovis/projects/lokalise_manager)
6
+ [![Maintainability](https://qlty.sh/gh/bodrovis/projects/lokalise_manager/maintainability.svg)](https://qlty.sh/gh/bodrovis/projects/lokalise_manager)
7
7
  ![Downloads total](https://img.shields.io/gem/dt/lokalise_manager)
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
@@ -34,7 +34,7 @@ module LokaliseManager
34
34
 
35
35
  # Return the path to locales
36
36
  def locales_path
37
- @locales_path || "#{Dir.getwd}/locales"
37
+ @locales_path || File.join(Dir.pwd, 'locales')
38
38
  end
39
39
 
40
40
  # Return the project branch
@@ -116,6 +116,7 @@ module LokaliseManager
116
116
  @export_preprocessor || ->(raw_data, _path) { raw_data }
117
117
  end
118
118
 
119
+ # Adjust filenames before exporting to Lokalise
119
120
  def export_filename_generator
120
121
  @export_filename_generator || ->(_full_path, relative_path) { relative_path }
121
122
  end
@@ -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 sleep cap
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
- .singleton_methods
74
- .select { |m| m.to_s.end_with?('=') }
75
- .each_with_object({}) do |method, opts|
76
- reader = method.to_s.delete_suffix('=')
77
- opts[reader.to_sym] = global_config.public_send(reader)
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
- raise(e.class, "Gave up after #{retries} retries") if retries >= max_retries
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
@@ -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 |threads|
27
- threads.each { |thr| raise_on_fail(thr) if config.raise_on_export_fail }
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 thread failed.
48
+ # Raises an error if a file upload result failed.
49
49
  #
50
- # @param thread [Struct] The result of the file upload thread.
51
- def raise_on_fail(thread)
52
- return if thread.success
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 thread.error
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).strip
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)),
@@ -72,13 +72,14 @@ module LokaliseManager
72
72
  # @raise [LokaliseManager::Error] If the process fails or takes too long.
73
73
  def wait_for_async_download(process_id)
74
74
  (config.max_retries_import + 1).times do |i|
75
- sleep 2**i
76
75
  process = reload_process(process_id)
77
76
 
78
77
  case process.status
79
78
  when 'failed' then raise LokaliseManager::Error, 'Asynchronous download process failed'
80
79
  when 'finished' then return process
81
80
  end
81
+
82
+ sleep_with_backoff(i)
82
83
  end
83
84
 
84
85
  raise LokaliseManager::Error, "Asynchronous download process timed out after #{config.max_retries_import} tries"
@@ -96,9 +97,12 @@ module LokaliseManager
96
97
  #
97
98
  # @param path [String] The URL or local path to the ZIP archive.
98
99
  def open_and_process_zip(path)
99
- Zip::File.open_buffer(open_file_or_remote(path)) do |zip|
100
+ io = open_file_or_remote(path)
101
+ Zip::File.open_buffer(io) do |zip|
100
102
  zip.each { |entry| process_entry(entry) if proper_ext?(entry.name) }
101
103
  end
104
+ ensure
105
+ io.close if io && !io.closed?
102
106
  end
103
107
 
104
108
  # Extracts data from a ZIP entry and writes it to the correct directory.
@@ -110,10 +114,22 @@ module LokaliseManager
110
114
  # @param zip_entry [Zip::Entry] The ZIP entry to process.
111
115
  def process_entry(zip_entry)
112
116
  data = data_from(zip_entry)
113
- full_path = File.join(config.locales_path, *subdir_and_filename_for(zip_entry.name))
114
- FileUtils.mkdir_p File.dirname(full_path)
117
+ dest = safe_dest_path(zip_entry.name)
118
+ return unless dest
119
+
120
+ FileUtils.mkdir_p(dest.dirname)
121
+ File.write(dest, config.translations_converter.call(data), mode: 'w:UTF-8')
122
+ end
123
+
124
+ def safe_dest_path(entry_name)
125
+ base = Pathname.new(config.locales_path).expand_path
126
+ normalized = entry_name.tr('\\', '/')
127
+ dest = base.join(normalized).cleanpath
128
+ base_s = base.to_s
129
+ dest_s = dest.to_s
130
+ return nil unless dest_s == base_s || dest_s.start_with?(base_s + File::SEPARATOR)
115
131
 
116
- File.write(full_path, config.translations_converter.call(data), mode: 'w+:UTF-8')
132
+ dest
117
133
  end
118
134
 
119
135
  # Checks whether the import should proceed under safe mode constraints.
@@ -123,9 +139,12 @@ module LokaliseManager
123
139
  #
124
140
  # @return [Boolean] `true` if the import should proceed, `false` otherwise.
125
141
  def proceed_when_safe_mode?
126
- return true unless config.import_safe_mode && !Dir.empty?(config.locales_path.to_s)
142
+ path = config.locales_path.to_s
143
+ return true unless config.import_safe_mode
144
+ return true unless Dir.exist?(path)
145
+ return true if Dir.empty?(path)
127
146
 
128
- $stdout.puts "The target directory #{config.locales_path} is not empty!"
147
+ $stdout.puts "The target directory #{path} is not empty!"
129
148
  $stdout.print 'Enter Y to continue: '
130
149
  $stdin.gets.strip.upcase == 'Y'
131
150
  end
@@ -136,7 +155,7 @@ module LokaliseManager
136
155
  # @return [IO] An IO object for reading the file.
137
156
  def open_file_or_remote(path)
138
157
  uri = URI.parse(path)
139
- uri.scheme&.start_with?('http') ? uri.open : File.open(path)
158
+ uri.scheme&.start_with?('http') ? uri.open(open_timeout: 10, read_timeout: 60) : File.open(path)
140
159
  end
141
160
 
142
161
  # Reads and processes data from a ZIP file entry.
@@ -154,6 +173,14 @@ module LokaliseManager
154
173
  def fetch_with_retry(&block)
155
174
  with_exp_backoff(config.max_retries_import, &block)
156
175
  end
176
+
177
+ # Extracts the subdirectory and filename from a given path.
178
+ #
179
+ # @param entry [String] The file path.
180
+ # @return [Array<Pathname, Pathname>] An array containing the subdirectory and filename.
181
+ def subdir_and_filename_for(entry)
182
+ Pathname.new(entry).split
183
+ end
157
184
  end
158
185
  end
159
186
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LokaliseManager
4
- VERSION = '6.4.0'
4
+ VERSION = '7.0.0'
5
5
  end
@@ -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
- LokaliseManager::TaskDefinitions::Importer.new custom_opts, global_config
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
- LokaliseManager::TaskDefinitions::Exporter.new custom_opts, global_config
56
+ TaskDefinitions::Exporter.new custom_opts, global_config
58
57
  end
59
58
  end
60
59
  end
@@ -17,27 +17,29 @@ Gem::Specification.new do |spec|
17
17
 
18
18
  spec.files = Dir['README.md', 'LICENSE',
19
19
  'CHANGELOG.md', 'lib/**/*.rb',
20
- 'lib/**/*.rake',
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
25
  spec.add_dependency 'ruby-lokalise-api', '~> 9.3'
28
- spec.add_dependency 'rubyzip', '~> 2.3'
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.6'
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.6'
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.16'
36
+ spec.add_development_dependency 'simplecov', '~> 0.22'
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: 6.4.0
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Krukowski
@@ -41,16 +41,22 @@ dependencies:
41
41
  name: rubyzip
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - "~>"
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: '2.3'
47
+ - - "<"
48
+ - !ruby/object:Gem::Version
49
+ version: '4.0'
47
50
  type: :runtime
48
51
  prerelease: false
49
52
  version_requirements: !ruby/object:Gem::Requirement
50
53
  requirements:
51
- - - "~>"
54
+ - - ">="
52
55
  - !ruby/object:Gem::Version
53
56
  version: '2.3'
57
+ - - "<"
58
+ - !ruby/object:Gem::Version
59
+ version: '4.0'
54
60
  - !ruby/object:Gem::Dependency
55
61
  name: zeitwerk
56
62
  requirement: !ruby/object:Gem::Requirement
@@ -99,14 +105,14 @@ dependencies:
99
105
  requirements:
100
106
  - - "~>"
101
107
  - !ruby/object:Gem::Version
102
- version: '3.6'
108
+ version: '3.13'
103
109
  type: :development
104
110
  prerelease: false
105
111
  version_requirements: !ruby/object:Gem::Requirement
106
112
  requirements:
107
113
  - - "~>"
108
114
  - !ruby/object:Gem::Version
109
- version: '3.6'
115
+ version: '3.13'
110
116
  - !ruby/object:Gem::Dependency
111
117
  name: rubocop
112
118
  requirement: !ruby/object:Gem::Requirement
@@ -141,14 +147,14 @@ dependencies:
141
147
  requirements:
142
148
  - - "~>"
143
149
  - !ruby/object:Gem::Version
144
- version: '0.6'
150
+ version: '0.7'
145
151
  type: :development
146
152
  prerelease: false
147
153
  version_requirements: !ruby/object:Gem::Requirement
148
154
  requirements:
149
155
  - - "~>"
150
156
  - !ruby/object:Gem::Version
151
- version: '0.6'
157
+ version: '0.7'
152
158
  - !ruby/object:Gem::Dependency
153
159
  name: rubocop-rspec
154
160
  requirement: !ruby/object:Gem::Requirement
@@ -169,14 +175,14 @@ dependencies:
169
175
  requirements:
170
176
  - - "~>"
171
177
  - !ruby/object:Gem::Version
172
- version: '0.16'
178
+ version: '0.22'
173
179
  type: :development
174
180
  prerelease: false
175
181
  version_requirements: !ruby/object:Gem::Requirement
176
182
  requirements:
177
183
  - - "~>"
178
184
  - !ruby/object:Gem::Version
179
- version: '0.16'
185
+ version: '0.22'
180
186
  - !ruby/object:Gem::Dependency
181
187
  name: webmock
182
188
  requirement: !ruby/object:Gem::Requirement
@@ -200,14 +206,9 @@ extensions: []
200
206
  extra_rdoc_files:
201
207
  - README.md
202
208
  files:
203
- - ".github/CODE_OF_CONDUCT.md"
204
- - ".github/CONTRIBUTING.md"
205
- - ".github/PULL_REQUEST_TEMPLATE.md"
206
209
  - CHANGELOG.md
207
- - Gemfile
208
210
  - LICENSE
209
211
  - README.md
210
- - Rakefile
211
212
  - lib/lokalise_manager.rb
212
213
  - lib/lokalise_manager/error.rb
213
214
  - lib/lokalise_manager/global_config.rb
@@ -222,6 +223,10 @@ licenses:
222
223
  - MIT
223
224
  metadata:
224
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
225
230
  rdoc_options: []
226
231
  require_paths:
227
232
  - lib
@@ -236,7 +241,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
236
241
  - !ruby/object:Gem::Version
237
242
  version: '0'
238
243
  requirements: []
239
- rubygems_version: 3.6.9
244
+ rubygems_version: 4.0.6
240
245
  specification_version: 4
241
246
  summary: Lokalise integration for Ruby
242
247
  test_files: []
@@ -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/
@@ -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
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'http://rubygems.org'
4
-
5
- gemspec
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