lokalise_manager 3.2.0 → 4.0.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: 62f150fda293c97544a2595165d42dd74c59b8e21bed613943d422321ade498f
4
- data.tar.gz: a4b01a90a1fe15f7ee7dd8d657ffd2433a5fdbcfb5785b2090b608530cec23f5
3
+ metadata.gz: e050488025db0f9c199092084e0b7925ffe56de86ea958f5647c073d396a1bc4
4
+ data.tar.gz: a172734358df197f42c6c1f54c12de213bd5cb76537bb75167d69fca9ea81e90
5
5
  SHA512:
6
- metadata.gz: 9c65ddeb0a5c671cc6bfdca8e01dbadb8f3ef7dd43d5c870694a243f8dd8e58893571185a01bb07c6c363b1b301b127f2cf7375f67b7c35675c24e6b7a60406d
7
- data.tar.gz: 4a43096baca8264d52c7a11ce91a08b73aaa87a3b1b16056f539746753926c6a23ad77f29e5d942d427633b0623031e488c8c66c6e5f466f0085fc721b57b9dc
6
+ metadata.gz: 73721527aed2b9fcfcdcf54c2475b6f9cc51307f82ab5c32a2736b6c909c48187d04c72ebfab1cd616293562a5c0bbbbc47dd41cd8e37d7eef83527c3452f86f
7
+ data.tar.gz: f42762cc96263e83c84be880678914265eb43dcd595050fa63d17f7e72bdb566af27185874ff1b135964cb8ce33e6ba61be2d2e2d321137c99777ab2e33b5374
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.0 (27-Jul-2023)
4
+
5
+ * **Use ruby-lokalise-api version 8**. It should not introduce any breaking changes (as main methods have similar signatures) but you should be aware that v8 is a complete rewrite of the original SDK so please make sure your tests pass.
6
+ * Replace VCR with WebMock in tests
7
+ * Various minor updates
8
+ * Do not test with Ruby 2.7 (EOL)
9
+
10
+ ## 3.3.0 (18-Nov-22)
11
+
12
+ * Use newer ruby-lokalise-api
13
+ * Minor updates
14
+
3
15
  ## 3.2.0 (26-Aug-22)
4
16
 
5
17
  * Fixed an issue when `\n` inside translations was imported as `\\n`. The default value for the `translations_converter` is now `->(raw_data) { YAML.dump(raw_data).gsub(/\\\\n/, '\n') }`.
@@ -15,6 +27,10 @@
15
27
  * Use Zeitwerk loader
16
28
  * Prettify and update source code
17
29
 
30
+ ## 2.2.1 (19-Oct-22)
31
+
32
+ * Replaced `filter` with `select` as it does not work with Ruby 2.5
33
+
18
34
  ## 2.2.0 (23-Feb-22)
19
35
 
20
36
  * Use ruby-lokalise-api v5
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2022 Lokalise team, Ilya Krukowski
3
+ Copyright (c) 2023 Ilya Krukowski
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -2,7 +2,7 @@
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
- [![Test Coverage](https://codecov.io/gh/bodrovis/lokalise_manager/graph/badge.svg)](https://codecov.io/gh/bodrovis/lokalise_manager)
5
+ [![Coverage Status](https://coveralls.io/repos/github/bodrovis/lokalise_manager/badge.svg?branch=master)](https://coveralls.io/github/bodrovis/lokalise_manager?branch=master)
6
6
  ![Downloads total](https://img.shields.io/gem/dt/lokalise_manager)
7
7
 
8
8
  This gem provides [Lokalise](http://lokalise.com) integration for Ruby and allows to exchange translation files between your project and TMS easily. It relies on [ruby-lokalise-api](https://lokalise.github.io/ruby-lokalise-api) to send APIv2 requests.
@@ -297,9 +297,9 @@ importer.import!
297
297
 
298
298
  ## Running tests
299
299
 
300
- 1. Copypaste `.env.example` file as `.env`. Put your Lokalise API token and project ID inside. The `.env` file is excluded from version control so your data is safe. All in all, we use pre-recorded VCR cassettes, so the actual API requests won’t be sent. However, providing at least some values is required.
300
+ 1. Copypaste `.env.example` file as `.env`. Put your Lokalise API token and project ID inside. The `.env` file is excluded from version control so your data is safe. All in all, we use stubs, so the actual API requests won’t be sent. However, providing at least some values is required.
301
301
  2. Run `rspec .`. Observe test results and code coverage.
302
302
 
303
303
  ## License
304
304
 
305
- Copyright (c) [Lokalise team](http://lokalise.com), [Ilya Krukowski](http://bodrovis.tech). License type is [MIT](https://github.com/bodrovis/lokalise_manager/blob/master/LICENSE).
305
+ Copyright (c) [Ilya Krukowski](http://bodrovis.tech). License type is [MIT](https://github.com/bodrovis/lokalise_manager/blob/master/LICENSE).
data/Rakefile CHANGED
@@ -1,6 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'rake'
4
+ require 'rake/clean'
5
+ require 'rspec/core/rake_task'
6
+ require 'rubocop/rake_task'
4
7
 
5
8
  begin
6
9
  require 'bundler/setup'
@@ -9,13 +12,33 @@ rescue LoadError
9
12
  puts 'although not required, bundler is recommened for running the tests'
10
13
  end
11
14
 
12
- task default: :spec
13
-
14
- require 'rspec/core/rake_task'
15
15
  RSpec::Core::RakeTask.new(:spec)
16
16
 
17
- require 'rubocop/rake_task'
18
17
  RuboCop::RakeTask.new do |task|
19
18
  task.requires << 'rubocop-performance'
20
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
21
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
@@ -95,7 +95,7 @@ module LokaliseManager
95
95
 
96
96
  # Converts translations data to the proper format
97
97
  def translations_converter
98
- @translations_converter || ->(raw_data) { YAML.dump(raw_data).gsub(/\\\\n/, '\n') }
98
+ @translations_converter || ->(raw_data) { YAML.dump(raw_data).gsub('\\\\n', '\n') }
99
99
  end
100
100
 
101
101
  # Infers lang ISO for the given translation file
@@ -17,10 +17,10 @@ module LokaliseManager
17
17
  # @param custom_opts [Hash]
18
18
  # @param global_config [Object]
19
19
  def initialize(custom_opts = {}, global_config = LokaliseManager::GlobalConfig)
20
- primary_opts = global_config.
21
- singleton_methods.
22
- filter { |m| m.to_s.end_with?('=') }.
23
- each_with_object({}) do |method, opts|
20
+ primary_opts = global_config
21
+ .singleton_methods
22
+ .filter { |m| m.to_s.end_with?('=') }
23
+ .each_with_object({}) do |method, opts|
24
24
  reader = method.to_s.delete_suffix('=')
25
25
  opts[reader.to_sym] = global_config.send(reader)
26
26
  end
@@ -47,7 +47,7 @@ module LokaliseManager
47
47
  fetch_zip_entries(zip) { |entry| process!(entry) }
48
48
  end
49
49
  rescue StandardError => e
50
- raise e.class, "There was an error when trying to process the downloaded files: #{e.message}"
50
+ raise(e.class, "There was an error when trying to process the downloaded files: #{e.message}")
51
51
  end
52
52
 
53
53
  # Iterates over ZIP entries. Each entry may be a file or folder.
@@ -92,6 +92,7 @@ module LokaliseManager
92
92
  # @return [String]
93
93
  def open_file_or_remote(path)
94
94
  parsed_path = URI.parse(path)
95
+
95
96
  if parsed_path&.scheme&.include?('http')
96
97
  parsed_path.open
97
98
  else
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LokaliseManager
4
- VERSION = '3.2.0'
4
+ VERSION = '4.0.0'
5
5
  end
@@ -8,7 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ['Ilya Krukowski']
9
9
  spec.email = ['golosizpru@gmail.com']
10
10
  spec.summary = 'Lokalise integration for Ruby'
11
- spec.description = 'This gem contains a collection of some common tasks for Lokalise. Specifically, it allows to import/export translation files from/to Lokalise TMS.'
11
+ spec.description = 'This gem contains a collection of some common tasks for Lokalise. Specifically, ' \
12
+ 'it allows to import/export translation files from/to Lokalise TMS.'
12
13
  spec.homepage = 'https://github.com/bodrovis/lokalise_manager'
13
14
  spec.license = 'MIT'
14
15
  spec.platform = Gem::Platform::RUBY
@@ -22,19 +23,20 @@ Gem::Specification.new do |spec|
22
23
  spec.extra_rdoc_files = ['README.md']
23
24
  spec.require_paths = ['lib']
24
25
 
25
- spec.add_dependency 'ruby-lokalise-api', '~> 6.0'
26
+ spec.add_dependency 'ruby-lokalise-api', '~> 8.0'
26
27
  spec.add_dependency 'rubyzip', '~> 2.3'
27
28
  spec.add_dependency 'zeitwerk', '~> 2.4'
28
29
 
29
- spec.add_development_dependency 'codecov', '~> 0.2'
30
30
  spec.add_development_dependency 'dotenv', '~> 2.5'
31
31
  spec.add_development_dependency 'rake', '~> 13.0'
32
32
  spec.add_development_dependency 'rspec', '~> 3.6'
33
33
  spec.add_development_dependency 'rubocop', '~> 1.0'
34
34
  spec.add_development_dependency 'rubocop-performance', '~> 1.5'
35
+ spec.add_development_dependency 'rubocop-rake', '~> 0.6'
35
36
  spec.add_development_dependency 'rubocop-rspec', '~> 2.6'
36
37
  spec.add_development_dependency 'simplecov', '~> 0.16'
37
- spec.add_development_dependency 'vcr', '~> 6.0'
38
+ spec.add_development_dependency 'simplecov-lcov', '~> 0.8'
39
+ spec.add_development_dependency 'webmock', '~> 3.18'
38
40
  spec.metadata = {
39
41
  'rubygems_mfa_required' => 'true'
40
42
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lokalise_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Krukowski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-26 00:00:00.000000000 Z
11
+ date: 2023-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-lokalise-api
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '6.0'
19
+ version: '8.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '6.0'
26
+ version: '8.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rubyzip
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.4'
55
- - !ruby/object:Gem::Dependency
56
- name: codecov
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '0.2'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '0.2'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: dotenv
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +122,20 @@ dependencies:
136
122
  - - "~>"
137
123
  - !ruby/object:Gem::Version
138
124
  version: '1.5'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop-rake
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '0.6'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '0.6'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rubocop-rspec
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -165,19 +165,33 @@ dependencies:
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0.16'
167
167
  - !ruby/object:Gem::Dependency
168
- name: vcr
168
+ name: simplecov-lcov
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '0.8'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '0.8'
181
+ - !ruby/object:Gem::Dependency
182
+ name: webmock
169
183
  requirement: !ruby/object:Gem::Requirement
170
184
  requirements:
171
185
  - - "~>"
172
186
  - !ruby/object:Gem::Version
173
- version: '6.0'
187
+ version: '3.18'
174
188
  type: :development
175
189
  prerelease: false
176
190
  version_requirements: !ruby/object:Gem::Requirement
177
191
  requirements:
178
192
  - - "~>"
179
193
  - !ruby/object:Gem::Version
180
- version: '6.0'
194
+ version: '3.18'
181
195
  description: This gem contains a collection of some common tasks for Lokalise. Specifically,
182
196
  it allows to import/export translation files from/to Lokalise TMS.
183
197
  email:
@@ -224,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
238
  - !ruby/object:Gem::Version
225
239
  version: '0'
226
240
  requirements: []
227
- rubygems_version: 3.3.21
241
+ rubygems_version: 3.4.17
228
242
  signing_key:
229
243
  specification_version: 4
230
244
  summary: Lokalise integration for Ruby