web_translate_it 1.9.0 → 1.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/wti +25 -15
- data/history.md +7 -0
- data/lib/web_translate_it/command_line.rb +1 -1
- data/lib/web_translate_it/translation_file.rb +7 -7
- data/version.yml +1 -1
- metadata +8 -8
data/bin/wti
CHANGED
@@ -3,27 +3,32 @@
|
|
3
3
|
require 'trollop'
|
4
4
|
require 'web_translate_it'
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
stop_on SUB_COMMANDS
|
9
|
-
banner <<-EOS
|
6
|
+
show_commands = <<-EOS
|
7
|
+
A CLI for syncing files with WebTranslateIt.com
|
10
8
|
|
11
9
|
Usage: wti <command> [options]+
|
12
|
-
|
10
|
+
|
13
11
|
The most commonly used wti commands are:
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
12
|
+
|
13
|
+
pull Pull target language file(s)
|
14
|
+
push Push master language file(s)
|
15
|
+
match Display matching of local files with File Manager
|
16
|
+
add Create and push a new master language file
|
17
|
+
rm Delete a master language file from a project
|
18
|
+
addlocale Add a new locale to the project
|
19
|
+
rmlocale Delete a locale from a project
|
20
|
+
status Fetch and display project statistics
|
21
|
+
init Configure your project to sync
|
22
22
|
|
23
23
|
See `wti <command> --help` for more information on a specific command.
|
24
|
-
|
24
|
+
|
25
25
|
[options] are:
|
26
26
|
EOS
|
27
|
+
|
28
|
+
SUB_COMMANDS = %w(pull push match add addlocale server status st init)
|
29
|
+
global_options = Trollop::options do
|
30
|
+
stop_on SUB_COMMANDS
|
31
|
+
banner show_commands
|
27
32
|
version "Web Translate It v#{WebTranslateIt::Util.version}"
|
28
33
|
end
|
29
34
|
|
@@ -103,7 +108,12 @@ EOS
|
|
103
108
|
opt :config, "Path to a translation.yml file", :short => "-c", :default => ".wti"
|
104
109
|
end
|
105
110
|
else
|
106
|
-
|
111
|
+
if command.nil?
|
112
|
+
puts show_commands
|
113
|
+
exit
|
114
|
+
else
|
115
|
+
Trollop::die "Unknown subcommand #{command.inspect}"
|
116
|
+
end
|
107
117
|
end
|
108
118
|
|
109
119
|
begin
|
data/history.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## Version 1.9.1 / 2011-12-08
|
2
|
+
|
3
|
+
* Add `wti rm` and `wti rmlocale` to CLI help.
|
4
|
+
* Sort files by name in `wti push`.
|
5
|
+
* Improve command-line interface. Executing `wti` should now give help.
|
6
|
+
* Bug fix: TranslationFile timeouts, #77. (@bray).
|
7
|
+
|
1
8
|
## Version 1.9.0 / 2011-11-23
|
2
9
|
|
3
10
|
* Deprecate `wti server`. This feature was introducing a hard dependency on Sinatra, which is not desirable when embedding `web_translate_it` on a Rails application. `wti server` now lives in a separate gem, `web_translate_it_server`, which depends on the `web_translate_it` gem. To keep using `wti server`, execute: `gem install web_translate_it_server` and run: `wti-server`.
|
@@ -51,7 +51,7 @@ module WebTranslateIt
|
|
51
51
|
puts StringUtil.titleize("Pushing files")
|
52
52
|
WebTranslateIt::Util.http_connection do |http|
|
53
53
|
fetch_locales_to_push(configuration).each do |locale|
|
54
|
-
configuration.files.find_all{ |file| file.locale == locale }.each do |file|
|
54
|
+
configuration.files.find_all{ |file| file.locale == locale }.sort{|a,b| a.file_path <=> b.file_path} .each do |file|
|
55
55
|
file.upload(http, command_options[:merge], command_options.ignore_missing, command_options.label, command_options.low_priority)
|
56
56
|
end
|
57
57
|
end
|
@@ -50,13 +50,13 @@ module WebTranslateIt
|
|
50
50
|
response = http_connection.request(request)
|
51
51
|
File.open(self.file_path, 'wb'){ |file| file << response.body } if response.code.to_i == 200 and response.body != ''
|
52
52
|
display.push Util.handle_response(response)
|
53
|
+
rescue Timeout::Error
|
54
|
+
puts StringUtil.failure("Request timeout. Will retry in 5 seconds.")
|
55
|
+
sleep(5)
|
56
|
+
retry
|
53
57
|
rescue
|
54
58
|
display.push StringUtil.failure("An error occured: #{$!}")
|
55
59
|
end
|
56
|
-
rescue Timeout::Error
|
57
|
-
puts StringUtil.failure("Request timeout. Will retry in 5 seconds.")
|
58
|
-
sleep(5)
|
59
|
-
fetch(http_connection, force)
|
60
60
|
end
|
61
61
|
else
|
62
62
|
display.push StringUtil.success("Skipped")
|
@@ -90,7 +90,7 @@ module WebTranslateIt
|
|
90
90
|
rescue Timeout::Error
|
91
91
|
puts StringUtil.failure("Request timeout. Will retry in 5 seconds.")
|
92
92
|
sleep(5)
|
93
|
-
|
93
|
+
retry
|
94
94
|
end
|
95
95
|
end
|
96
96
|
else
|
@@ -124,7 +124,7 @@ module WebTranslateIt
|
|
124
124
|
rescue Timeout::Error
|
125
125
|
puts StringUtil.failure("Request timeout. Will retry in 5 seconds.")
|
126
126
|
sleep(5)
|
127
|
-
|
127
|
+
retry
|
128
128
|
end
|
129
129
|
end
|
130
130
|
else
|
@@ -149,7 +149,7 @@ module WebTranslateIt
|
|
149
149
|
rescue Timeout::Error
|
150
150
|
puts StringUtil.failure("Request timeout. Will retry in 5 seconds.")
|
151
151
|
sleep(5)
|
152
|
-
|
152
|
+
retry
|
153
153
|
end
|
154
154
|
end
|
155
155
|
else
|
data/version.yml
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web_translate_it
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-12-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multipart-post
|
16
|
-
requirement: &
|
16
|
+
requirement: &70346835324020 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.1.3
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70346835324020
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: trollop
|
27
|
-
requirement: &
|
27
|
+
requirement: &70346835323520 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.16.2
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70346835323520
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &70346835323060 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: 2.6.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70346835323060
|
47
47
|
description:
|
48
48
|
email: edouard@atelierconvivialite.com
|
49
49
|
executables:
|