web_translate_it 2.7.3 → 2.7.5

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: 92adb002b0df15870368f976f18aaaa8f360b456517ea5d9e7448c44bc82e455
4
- data.tar.gz: c2511b8b3f37936d476e2af8f0e23f5dfb60831466f7dad70de9d587fa174a3e
3
+ metadata.gz: 9d28dda70be5e71eeb61a269cceedb3f1406640b4e5526bed6f33d239d1b8527
4
+ data.tar.gz: 670de23342b5adbbe052373c918a5b757438d42051c51bd9e7b2dc97c23e78bf
5
5
  SHA512:
6
- metadata.gz: 5f2085374587cbe5a78ded34b5675ee56d26658bd16529149268952fa93c606b39008d6bd73f96a77b7e5eb21c7058ac8ce864fb17d5dce9e022c856f2f162e5
7
- data.tar.gz: 40df440171537d90c6cf54a7ae3499b042a4727f28150c7817f9b24c814844b5e3e03177019d8140952bfd814cf7aa55df542b4b6bd665837468257daf55e4e7
6
+ metadata.gz: 4a7cc04fe367c0b4541b48f1dc08ecda4deedc9891dd4f92f1622060aac4f46cbe6cd0867791f319893e69f2ad50c604684a70c1071168f6b28fbe7d99631315
7
+ data.tar.gz: 22800578ddbe6ccadd5231ede8fc6bdb9a743692eb17235eff3174c3c1d241a5cc1bcf7bf95096572ced08ac71308ed333625b08a700b657457380489b7f82ea
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.5 / 2022-11-17
2
+
3
+ * wti now works with `multipart_post = 2.0.0` AND `multipart_post >= 2.2.0`.
4
+
5
+ ## Version 2.7.4 / 2022-11-01
6
+
7
+ * 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.
8
+
1
9
  ## Version 2.7.3 / 2022-10-28
2
10
 
3
11
  * Relax dependency on `multipart_post`. Also made sure that wti works with `multipart_post >= 2.0.0 and < 2.3`.
@@ -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,5 +1,4 @@
1
1
  require 'fileutils'
2
- require 'multipart/post'
3
2
  require 'yaml'
4
3
  require 'erb'
5
4
  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.3
4
+ version: 2.7.5
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-28 00:00:00.000000000 Z
11
+ date: 2022-11-17 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.21
118
118
  signing_key:
119
119
  specification_version: 4
120
120
  summary: A CLI tool to sync locale files with WebTranslateIt.com.