web_translate_it 2.7.4 → 2.7.6

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: 2cf961665ffe5011712709893326b9ec48a791ee3849bd06640dac2df96a5c70
4
- data.tar.gz: ccfc17ed10d527814aba5a60b7452994a8b98465c5bea523a777834160105670
3
+ metadata.gz: 0a436c9096b05eeedb453e204e6b8b0ed064d8ab1af97383b1feead324d181f1
4
+ data.tar.gz: b3a312fc0d408c4024592a5b3d5f764a103e4558ec3cc27482278094f29e78e2
5
5
  SHA512:
6
- metadata.gz: c4f2ae022af39cd0e30f4a1daa82f4e18d4134344f90e99f8dca0a16a4800a28898ac4bec67bb43358fc8c09bf5cfbeb30bd00ea19d38d37babc6fae2da041b0
7
- data.tar.gz: 403d582ec95fc17fb8f464bfc046552fac0f0a572feb0e59bfd27687f8680978a662751fa1f57f6ccf4964924c446ebc59fb50a8857b1b404aba4478ac2ea212
6
+ metadata.gz: e89ce30242409de171037ec6909bf5c0d88eff803a4c724e20391ea9701d2ac28c798eadc1d5b9ed3406ccb1feabde54425f6d47216eea6f56c9d88b2b08a762
7
+ data.tar.gz: 5dff6abe4bec0d45d2a5b5c1f92b01b7a7d29658fefb50c99ae015f609bcb8d3376ef414c76e1d3fc67124372479c502b7093a92d1766f367ac285a93c030fdc
data/history.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## Version 2.7.6 / 2023-01-02
2
+
3
+ * Add ruby 3.2 to CI matrix.
4
+ * Dependencies upgrade and code refactoring.
5
+
6
+ ## Version 2.7.5 / 2022-11-17
7
+
8
+ * wti now works with `multipart_post = 2.0.0` AND `multipart_post >= 2.2.0`.
9
+
1
10
  ## Version 2.7.4 / 2022-11-01
2
11
 
3
12
  * Remove `low-priority` argument as in `wti push --low-priority` and `wti add --low-priority`. All the file imports in WebTranslateIt.com are now top priority.
@@ -57,7 +57,7 @@ module WebTranslateIt
57
57
  # Now actually pulling files
58
58
  time = Time.now
59
59
  threads = []
60
- n_threads = (files.size.to_f / 3).ceil >= 10 ? 10 : (files.size.to_f / 3).ceil
60
+ n_threads = [(files.size.to_f / 3).ceil, 10].min
61
61
  ArrayUtil.chunk(files, n_threads).each do |file_array|
62
62
  next if file_array.empty?
63
63
 
@@ -148,7 +148,7 @@ module WebTranslateIt
148
148
  end
149
149
  end
150
150
 
151
- def add # rubocop:todo Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/MethodLength, Metrics/PerceivedComplexity
151
+ def add # rubocop:todo Metrics/AbcSize, Metrics/MethodLength
152
152
  complete_success = true
153
153
  $stdout.sync = true
154
154
  if parameters == []
@@ -157,7 +157,7 @@ module WebTranslateIt
157
157
  exit
158
158
  end
159
159
  WebTranslateIt::Connection.new(configuration.api_key) do |http|
160
- added = configuration.files.find_all { |file| file.locale == configuration.source_locale }.collect { |file| File.expand_path(file.file_path) }.to_set
160
+ added = configuration.files.find_all { |file| file.locale == configuration.source_locale }.to_set { |file| File.expand_path(file.file_path) }
161
161
  to_add = parameters.reject { |param| added.include?(File.expand_path(param)) }
162
162
  if to_add.any?
163
163
  to_add.each do |param|
@@ -147,7 +147,7 @@ module WebTranslateIt
147
147
  display.push "#{StringUtil.checksumify(local_checksum.to_s)}..[ ]"
148
148
  if File.exist?(file_path)
149
149
  File.open(file_path) do |file|
150
- request = Net::HTTP::Post::Multipart.new(api_url_for_create, {'name' => file_path, 'file' => Multipart::Post::UploadIO.new(file, 'text/plain', file.path)})
150
+ request = ::Net::HTTP::Post::Multipart.new(api_url_for_create, {'name' => file_path, 'file' => Multipart::Post::UploadIO.new(file, 'text/plain', file.path)})
151
151
  WebTranslateIt::Util.add_fields(request)
152
152
  display.push Util.handle_response(http_connection.request(request))
153
153
  puts ArrayUtil.to_columns(display)
@@ -1,5 +1,4 @@
1
1
  require 'fileutils'
2
- require 'multipart/post'
3
2
  require 'yaml'
4
3
  require 'erb'
5
4
  require 'net/http'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web_translate_it
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.4
4
+ version: 2.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edouard Briere
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-01 00:00:00.000000000 Z
11
+ date: 2023-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  - !ruby/object:Gem::Version
115
115
  version: '0'
116
116
  requirements: []
117
- rubygems_version: 3.3.23
117
+ rubygems_version: 3.3.26
118
118
  signing_key:
119
119
  specification_version: 4
120
120
  summary: A CLI tool to sync locale files with WebTranslateIt.com.