web_translate_it 3.1.0 → 3.1.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4db3eb8623580c53dff0ca3d6e4dea860781436b20c9ff4580bf53e5a7661d0
|
4
|
+
data.tar.gz: f68c3e3ef4b7ed934a6df20da1c4eb13afaa7c115468595f241efc4bc3f5dea5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2faab2844f1ed735004291f6dc7def7cdb630837c18e4e526ca90dc83cb537379090f825403a5cfb2b758fa7213945419fd47eb45e849b154b20af1cbf54d3a5
|
7
|
+
data.tar.gz: b1ae273de1459eabe8ad461d0eee5261e2428aff6ad69230ee7af9a1806302efb09fcea4af7f864c0f6fde697ef7558339777717d583a6cdac95e92a5e9c70ae
|
data/history.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## Version 3.1.2 / 2025-06-06
|
2
|
+
|
3
|
+
* Fix `wti mv` command. #366
|
4
|
+
|
5
|
+
## Version 3.1.1 / 2024-10-07
|
6
|
+
|
7
|
+
* Remove unused rake generators. Use `wti init` command instead.
|
8
|
+
|
1
9
|
## Version 3.1.0 / 2024-09-19
|
2
10
|
|
3
11
|
* Remove support for ruby 2.7. Minimum supported ruby version is 3.0. #328
|
@@ -228,7 +228,7 @@ module WebTranslateIt
|
|
228
228
|
WebTranslateIt::Connection.new(configuration.api_key) do |http|
|
229
229
|
if Util.ask_yes_no("Are you sure you want to move the master file #{source} and its target files?", true)
|
230
230
|
configuration.files.find_all { |file| file.file_path == source }.each do |master_file|
|
231
|
-
master_file.upload(http, false, false, nil, false,
|
231
|
+
master_file.upload(http, false, false, nil, false, true, true, destination)
|
232
232
|
# move master file
|
233
233
|
if File.exist?(source)
|
234
234
|
success = File.rename(source, destination) if File.exist?(source)
|
data/readme.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# WebTranslateIt Synchronization Tool : wti
|
2
2
|
|
3
|
-
[
|
3
|
+
[](https://rubygems.org/gems/web_translate_it/) |
|
4
4
|
[Report a bug](https://github.com/webtranslateit/webtranslateit/issues) |
|
5
5
|
[Support](https://webtranslateit.com/support) |
|
6
6
|
[WebTranslateIt.com Homepage](https://webtranslateit.com) |
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web_translate_it
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edouard Briere
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-06-06 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: multi_json
|
@@ -49,8 +48,6 @@ extra_rdoc_files:
|
|
49
48
|
files:
|
50
49
|
- bin/wti
|
51
50
|
- examples/locale.rb
|
52
|
-
- generators/webtranslateit/lib/insert_commands.rb
|
53
|
-
- generators/webtranslateit/webtranslateit_generator.rb
|
54
51
|
- history.md
|
55
52
|
- lib/web_translate_it.rb
|
56
53
|
- lib/web_translate_it/auto_fetch.rb
|
@@ -82,7 +79,6 @@ metadata:
|
|
82
79
|
homepage_uri: https://webtranslateit.com
|
83
80
|
source_code_uri: https://github.com/webtranslateit/webtranslateit
|
84
81
|
wiki_uri: https://github.com/webtranslateit/webtranslateit/wiki
|
85
|
-
post_install_message:
|
86
82
|
rdoc_options:
|
87
83
|
- "--main"
|
88
84
|
- readme.md
|
@@ -99,8 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
95
|
- !ruby/object:Gem::Version
|
100
96
|
version: '0'
|
101
97
|
requirements: []
|
102
|
-
rubygems_version: 3.
|
103
|
-
signing_key:
|
98
|
+
rubygems_version: 3.6.2
|
104
99
|
specification_version: 4
|
105
100
|
summary: A CLI tool to sync locale files with WebTranslateIt.com.
|
106
101
|
test_files: []
|
@@ -1,34 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Mostly pinched from http://github.com/ryanb/nifty-generators/tree/master
|
4
|
-
|
5
|
-
Rails::Generator::Commands::Base.class_eval do
|
6
|
-
def file_contains?(relative_destination, line)
|
7
|
-
File.read(destination_path(relative_destination)).include?(line)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
Rails::Generator::Commands::Create.class_eval do
|
12
|
-
def append_to(file, line)
|
13
|
-
logger.insert "#{line} appended to #{file}"
|
14
|
-
return if options[:pretend] || file_contains?(file, line)
|
15
|
-
|
16
|
-
File.open(file, 'a') do |f|
|
17
|
-
f.puts
|
18
|
-
f.puts line
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
Rails::Generator::Commands::Destroy.class_eval do
|
24
|
-
def append_to(file, line)
|
25
|
-
logger.remove "#{line} removed from #{file}"
|
26
|
-
gsub_file file, "\n#{line}", '' unless options[:pretend]
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
Rails::Generator::Commands::List.class_eval do
|
31
|
-
def append_to(file, line)
|
32
|
-
logger.insert "#{line} appended to #{file}"
|
33
|
-
end
|
34
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require File.expand_path("#{File.dirname(__FILE__)}/lib/insert_commands.rb")
|
4
|
-
|
5
|
-
class WebtranslateitGenerator < Rails::Generator::Base
|
6
|
-
|
7
|
-
def add_options!(opt)
|
8
|
-
opt.on('-k', '--api-key=key', String, 'Your Web Translate It API key') { |v| options[:api_key] = v }
|
9
|
-
end
|
10
|
-
|
11
|
-
def manifest # rubocop:todo Metrics/AbcSize, Metrics/MethodLength
|
12
|
-
if !api_key_configured? && !options[:api_key]
|
13
|
-
puts 'You must pass --api-key or create config/translations.yml'
|
14
|
-
exit
|
15
|
-
end
|
16
|
-
record do |m|
|
17
|
-
if options[:api_key]
|
18
|
-
project_details = YAML.safe_load WebTranslateIt::Project.fetch_info(options[:api_key])
|
19
|
-
m.template '.wti', '.wti',
|
20
|
-
assigns: {api_key: options[:api_key], project: project_details['project']}
|
21
|
-
m.append_to 'Rakefile', "require 'web_translate_it' rescue LoadError"
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def api_key_configured?
|
27
|
-
File.exist?('config/translations.yml')
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|