web_translate_it 2.7.2 → 2.7.4

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: c59f3a4a6ea7997d54567b00007c0606e07b250473678f2fc2a14bf2b73c8cc8
4
- data.tar.gz: 3dd474c5c9e05312122fcd6817478068f11bb5ea4e4fadb743a57b4ca8f24a83
3
+ metadata.gz: 2cf961665ffe5011712709893326b9ec48a791ee3849bd06640dac2df96a5c70
4
+ data.tar.gz: ccfc17ed10d527814aba5a60b7452994a8b98465c5bea523a777834160105670
5
5
  SHA512:
6
- metadata.gz: 69b6977f8438f0364261334b1cd1b0b26181b084113dbdd5573d95fe52f33f09a1c0043b7fcaf0f51ff28b8aa5c5728f275bd25726078611a825a6700784fd2a
7
- data.tar.gz: 4b687e74044b6884b3ee13c83e9eafb26d1aee6991d183882d5bfeaa0ae94930003f21db598d78469f910e491d0b16954949b037343e24052a6f78af50a3c859
6
+ metadata.gz: c4f2ae022af39cd0e30f4a1daa82f4e18d4134344f90e99f8dca0a16a4800a28898ac4bec67bb43358fc8c09bf5cfbeb30bd00ea19d38d37babc6fae2da041b0
7
+ data.tar.gz: 403d582ec95fc17fb8f464bfc046552fac0f0a572feb0e59bfd27687f8680978a662751fa1f57f6ccf4964924c446ebc59fb50a8857b1b404aba4478ac2ea212
data/bin/wti CHANGED
@@ -55,7 +55,7 @@ when 'push'
55
55
  opt :locale, 'ISO code of locale(s) to push, space-separated', type: :string
56
56
  opt :target, 'Upload all target files'
57
57
  opt :force, 'Force push (bypass conditional requests to WTI)'
58
- opt :low_priority, 'WTI will process this file with a low priority'
58
+ opt :low_priority, 'Deprecated: option to process this file with a low priority'
59
59
  opt :merge, 'Force WTI to merge this file'
60
60
  opt :ignore_missing, 'Force WTI to not obsolete missing strings'
61
61
  opt :minor, 'Minor Changes. When pushing a master file, prevents target translations to be flagged as `to_verify`.'
@@ -67,7 +67,7 @@ when 'push'
67
67
  when 'add'
68
68
  Optimist.options do
69
69
  banner 'wti add filename - Create and push a new master language file'
70
- opt :low_priority, 'WTI will process this file with a low priority'
70
+ opt :low_priority, 'Deprecated: option to process this file with a low priority'
71
71
  opt :config, 'Path to a configuration file', short: '-c', default: '.wti'
72
72
  opt :debug, 'Display debug information'
73
73
  end
data/history.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## Version 2.7.4 / 2022-11-01
2
+
3
+ * 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.
4
+
5
+ ## Version 2.7.3 / 2022-10-28
6
+
7
+ * Relax dependency on `multipart_post`. Also made sure that wti works with `multipart_post >= 2.0.0 and < 2.3`.
8
+
1
9
  ## Version 2.7.2 / 2022-10-14
2
10
 
3
11
  * Specify a minimum version for dependency `multipart_post`.
@@ -101,6 +101,7 @@ module WebTranslateIt
101
101
  end
102
102
 
103
103
  def push # rubocop:todo Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/MethodLength, Metrics/PerceivedComplexity
104
+ puts 'The `--low-priority` option in `wti push --low-priority` was removed and does nothing' if command_options.low_priority
104
105
  complete_success = true
105
106
  $stdout.sync = true
106
107
  before_push_hook
@@ -115,7 +116,7 @@ module WebTranslateIt
115
116
  puts "Couldn't find any local files registered on WebTranslateIt to push."
116
117
  else
117
118
  files.each do |file|
118
- success = file.upload(http, command_options[:merge], command_options.ignore_missing, command_options.label, command_options.low_priority, command_options[:minor], command_options.force)
119
+ success = file.upload(http, command_options[:merge], command_options.ignore_missing, command_options.label, command_options[:minor], command_options.force)
119
120
  complete_success = false unless success
120
121
  end
121
122
  end
@@ -161,7 +162,7 @@ module WebTranslateIt
161
162
  if to_add.any?
162
163
  to_add.each do |param|
163
164
  file = TranslationFile.new(nil, param.gsub(/ /, '\\ '), nil, configuration.api_key)
164
- success = file.create(http, command_options.low_priority)
165
+ success = file.create(http)
165
166
  complete_success = false unless success
166
167
  end
167
168
  else
@@ -87,7 +87,7 @@ module WebTranslateIt
87
87
  # rubocop:todo Metrics/ParameterLists
88
88
  # rubocop:todo Metrics/MethodLength
89
89
  # rubocop:todo Metrics/AbcSize
90
- def upload(http_connection, merge = false, ignore_missing = false, label = nil, low_priority = false, minor_changes = false, force = false, rename_others = false, destination_path = nil) # rubocop:todo Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/MethodLength, Metrics/ParameterLists, Metrics/PerceivedComplexity
90
+ def upload(http_connection, merge = false, ignore_missing = false, label = nil, minor_changes = false, force = false, rename_others = false, destination_path = nil) # rubocop:todo Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/MethodLength, Metrics/ParameterLists, Metrics/PerceivedComplexity
91
91
  success = true
92
92
  tries ||= 3
93
93
  display = []
@@ -96,7 +96,7 @@ module WebTranslateIt
96
96
  if File.exist?(file_path)
97
97
  if force || (remote_checksum != local_checksum)
98
98
  File.open(file_path) do |file|
99
- params = {'file' => Multipart::Post::UploadIO.new(file, 'text/plain', file.path), 'merge' => merge, 'ignore_missing' => ignore_missing, 'label' => label, 'low_priority' => low_priority, 'minor_changes' => minor_changes}
99
+ params = {'file' => ::Multipart::Post::UploadIO.new(file, 'text/plain', file.path), 'merge' => merge, 'ignore_missing' => ignore_missing, 'label' => label, 'minor_changes' => minor_changes}
100
100
  params['name'] = destination_path unless destination_path.nil?
101
101
  params['rename_others'] = rename_others
102
102
  request = Net::HTTP::Put::Multipart.new(api_url, params)
@@ -139,7 +139,7 @@ module WebTranslateIt
139
139
  # Note that the request might or might not eventually be acted upon, as it might be disallowed when processing
140
140
  # actually takes place. This is due to the fact that language file imports are handled by background processing.
141
141
  #
142
- def create(http_connection, low_priority = false) # rubocop:todo Metrics/AbcSize, Metrics/MethodLength
142
+ def create(http_connection) # rubocop:todo Metrics/AbcSize, Metrics/MethodLength
143
143
  success = true
144
144
  tries ||= 3
145
145
  display = []
@@ -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), 'low_priority' => low_priority})
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,4 +1,5 @@
1
1
  require 'fileutils'
2
+ require 'multipart/post'
2
3
  require 'yaml'
3
4
  require 'erb'
4
5
  require 'net/http'
data/readme.md CHANGED
@@ -99,7 +99,6 @@ Append `--help` for each command for more information. For instance:
99
99
  -l, --locale=<s> ISO code of locale(s) to push
100
100
  -t, --target Upload all target files
101
101
  -f, --force Force push (bypass conditional requests to WTI)
102
- -o, --low-priority WTI will process this file with a low priority
103
102
  -m, --merge Force WTI to merge this file
104
103
  -i, --ignore-missing Force WTI to not obsolete missing strings
105
104
  -n, --minor Minor Changes. When pushing a master file, prevents
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.2
4
+ version: 2.7.4
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-10-14 00:00:00.000000000 Z
11
+ date: 2022-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.2'
33
+ version: '2.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '2.2'
40
+ version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: optimist
43
43
  requirement: !ruby/object:Gem::Requirement