web_translate_it 2.5.3 → 2.5.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 +4 -4
- data/history.md +4 -0
- data/lib/web_translate_it/command_line.rb +49 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc4a1374f3018354d15fea035305984fa839a6786526cc88e8d3151f176d8f79
|
4
|
+
data.tar.gz: fbc8868713a8d691169eea12318bb0c288853c25cedf24ddaaac10b44b461d09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8ec5eae4ac2941ca048cc798fb4ae5cb5c539345d11286d9aa35a68dca5e35cc3e138cbcb95c0ebf5d8adaffda69938cf41613762612a9ba33836e6f95f2871
|
7
|
+
data.tar.gz: 20af38470f30300f01d260e17d15d16ef90597b72d5e1e5f5d9869cf70a192c65d84f3dc9771ada30264f65c75ebfb0855da9b9f0e94e966cfc908cc872b3eda
|
data/history.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## Version 2.5.4 / 2022-03-08
|
2
|
+
|
3
|
+
* Better support for `before_pull`, `after_pull`, `before_push`, `after_push` hooks. They now display the command output, and write an error message if the exit status of the command was not successful.
|
4
|
+
|
1
5
|
## Version 2.5.3 / 2022-02-04
|
2
6
|
|
3
7
|
* Properly fix ruby compatibility issues.
|
@@ -36,7 +36,7 @@ module WebTranslateIt
|
|
36
36
|
def pull
|
37
37
|
complete_success = true
|
38
38
|
STDOUT.sync = true
|
39
|
-
|
39
|
+
before_pull_hook
|
40
40
|
# Selecting files to pull
|
41
41
|
files = []
|
42
42
|
fetch_locales_to_pull.each do |locale|
|
@@ -70,15 +70,37 @@ module WebTranslateIt
|
|
70
70
|
threads.each { |thread| thread.join }
|
71
71
|
time = Time.now - time
|
72
72
|
puts "Pulled #{files.size} files at #{(files.size/time).round} files/sec, using #{n_threads} threads."
|
73
|
-
|
73
|
+
after_pull_hook
|
74
74
|
complete_success
|
75
75
|
end
|
76
76
|
end
|
77
|
-
|
77
|
+
|
78
|
+
def before_pull_hook
|
79
|
+
if configuration.before_pull
|
80
|
+
output = `#{configuration.before_pull}`
|
81
|
+
if $?.success?
|
82
|
+
puts output
|
83
|
+
else
|
84
|
+
abort 'Error: exit code for before_pull command is not zero'
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
def after_pull_hook
|
90
|
+
if configuration.after_pull
|
91
|
+
output = `#{configuration.after_pull}`
|
92
|
+
if $?.success?
|
93
|
+
puts output
|
94
|
+
else
|
95
|
+
abort 'Error: exit code for after_pull command is not zero'
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
78
100
|
def push
|
79
101
|
complete_success = true
|
80
102
|
STDOUT.sync = true
|
81
|
-
|
103
|
+
before_push_hook
|
82
104
|
WebTranslateIt::Connection.new(configuration.api_key) do |http|
|
83
105
|
fetch_locales_to_push(configuration).each do |locale|
|
84
106
|
if parameters.any?
|
@@ -96,9 +118,31 @@ module WebTranslateIt
|
|
96
118
|
end
|
97
119
|
end
|
98
120
|
end
|
99
|
-
|
121
|
+
after_push_hook
|
100
122
|
complete_success
|
101
123
|
end
|
124
|
+
|
125
|
+
def before_push_hook
|
126
|
+
if configuration.before_push
|
127
|
+
output = `#{configuration.before_push}`
|
128
|
+
if $?.success?
|
129
|
+
puts output
|
130
|
+
else
|
131
|
+
abort 'Error: exit code for before_push command is not zero'
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
def after_push_hook
|
137
|
+
if configuration.after_push
|
138
|
+
output = `#{configuration.after_push}`
|
139
|
+
if $?.success?
|
140
|
+
puts output
|
141
|
+
else
|
142
|
+
abort 'Error: exit code for after_push command is not zero'
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
102
146
|
|
103
147
|
def add
|
104
148
|
complete_success = true
|
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.5.
|
4
|
+
version: 2.5.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-
|
11
|
+
date: 2022-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multipart-post
|
@@ -155,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
155
|
- !ruby/object:Gem::Version
|
156
156
|
version: '0'
|
157
157
|
requirements: []
|
158
|
-
rubygems_version: 3.
|
158
|
+
rubygems_version: 3.1.6
|
159
159
|
signing_key:
|
160
160
|
specification_version: 4
|
161
161
|
summary: A CLI to sync locale files with WebTranslateIt.com.
|