lokalise_manager 3.1.0 → 3.3.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: 71731c95118ae4f31be9e82b256aa2cc17094a0ab64b5a186b95cb37843fec52
4
- data.tar.gz: d8cbbfd4d60926f2f62323e0908addacf218425fc7e2b579d2f748d0e9acdf93
3
+ metadata.gz: eec5391729d2e75849846e323f88ca9817b01b0fa67c3293c7a14a23edbfea7a
4
+ data.tar.gz: 8ce91e9c150e5a7c93c7009f027160ceeab4b3e5ebcec3928cf4cfd51476bfc8
5
5
  SHA512:
6
- metadata.gz: d457a5a7e4f703b80c3780e1a35e75278671c78f9caa0464bb0488352fa2772500e9f4f921446f8a3b51e9240fd229b1935705ba5b86263cb9e20bd27eab274d
7
- data.tar.gz: 7053cf881bee4814dd67f17238557f7e19a0f6dc96109cf88700845018110c083612477eb15b49643d2459332d7e6abbd705cfe9322d36aa4735d7e73bcf887c
6
+ metadata.gz: cb1433d03eb8c52017600dd6833c8cb0214de4ffdaf0215c4bbe700794f3a10ea260f787e56a6393796943d48973e93161314e78f0f330120f3e0478b8895a07
7
+ data.tar.gz: f109171b02e72eee8ded4aa43c549815170903e0dd6a4b14cc37b20a2b93282dc1f588e8be75c5cceb0e92ac77ec41ee1ad9888e65009d7997d1c61938bf73da
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.3.0 (18-Nov-22)
4
+
5
+ * Use newer ruby-lokalise-api
6
+ * Minor updates
7
+
8
+ ## 3.2.0 (26-Aug-22)
9
+
10
+ * 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') }`.
11
+
3
12
  ## 3.1.0 (17-Aug-22)
4
13
 
5
14
  * The default format is now `ruby_yaml` (it used to be `yaml`)
@@ -11,6 +20,10 @@
11
20
  * Use Zeitwerk loader
12
21
  * Prettify and update source code
13
22
 
23
+ ## 2.2.1 (19-Oct-22)
24
+
25
+ * Replaced `filter` with `select` as it does not work with Ruby 2.5
26
+
14
27
  ## 2.2.0 (23-Feb-22)
15
28
 
16
29
  * Use ruby-lokalise-api v5
data/README.md CHANGED
@@ -201,7 +201,7 @@ If your translation files are not in YAML format, you will need to adjust the fo
201
201
 
202
202
  * `file_ext_regexp` (`regexp`) — regular expression applied to file extensions to determine which files should be imported and exported. Defaults to `/\.ya?ml\z/i` (YAML files).
203
203
  * `translations_loader` (`lambda` or `proc`) — loads translations data and makes sure they are valid before saving them to a translation file. Defaults to `->(raw_data) { YAML.safe_load raw_data }`. In the simplest case you may just return the data back, for example `-> (raw_data) { raw_data }`.
204
- * `translations_converter` (`lambda` or `proc`) — converts translations data to a proper format before saving them to a translation file. Defaults to `->(raw_data) { raw_data.to_yaml }`. In the simplest case you may just return the data back, for example `-> (raw_data) { raw_data }`.
204
+ * `translations_converter` (`lambda` or `proc`) — converts translations data to a proper format before saving them to a translation file. Defaults to `->(raw_data) { YAML.dump(raw_data).gsub(/\\\\n/, '\n') }`. In the simplest case you may just return the data back, for example `-> (raw_data) { raw_data }`.
205
205
  * `lang_iso_inferer` (`lambda` or `proc`) — infers language ISO code based on the translation file data before uploading it to Lokalise. Defaults to `->(data) { YAML.safe_load(data)&.keys&.first }`.
206
206
 
207
207
  ### Customizing JSON parser and network adapter
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) { raw_data.to_yaml }
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
@@ -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.1.0'
4
+ VERSION = '3.3.0'
5
5
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'zeitwerk'
4
4
  require 'yaml'
5
+ require 'psych'
5
6
 
6
7
  loader = Zeitwerk::Loader.for_gem
7
8
  loader.setup
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.extra_rdoc_files = ['README.md']
23
23
  spec.require_paths = ['lib']
24
24
 
25
- spec.add_dependency 'ruby-lokalise-api', '~> 6.0'
25
+ spec.add_dependency 'ruby-lokalise-api', '~> 7'
26
26
  spec.add_dependency 'rubyzip', '~> 2.3'
27
27
  spec.add_dependency 'zeitwerk', '~> 2.4'
28
28
 
@@ -32,6 +32,7 @@ Gem::Specification.new do |spec|
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
38
  spec.add_development_dependency 'vcr', '~> 6.0'
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.1.0
4
+ version: 3.3.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-17 00:00:00.000000000 Z
11
+ date: 2022-11-18 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: '7'
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: '7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rubyzip
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: '1.5'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rubocop-rake
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '0.6'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '0.6'
139
153
  - !ruby/object:Gem::Dependency
140
154
  name: rubocop-rspec
141
155
  requirement: !ruby/object:Gem::Requirement
@@ -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.19
241
+ rubygems_version: 3.3.26
228
242
  signing_key:
229
243
  specification_version: 4
230
244
  summary: Lokalise integration for Ruby