web_translate_it 2.1.2 → 2.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +10 -10
- data/bin/wti +1 -1
- data/history.md +6 -0
- data/lib/web_translate_it/command_line.rb +7 -2
- data/lib/web_translate_it/configuration.rb +15 -10
- data/lib/web_translate_it/util.rb +1 -1
- metadata +47 -47
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZmNkNGJiY2Y5YWU3NDQ1MzJmMjNlOTdjMmUzMzc2Zjg5Y2YyNGViOA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
7
|
-
|
6
|
+
ZjZkOGQwNzBjNTFjOGVlMjIyYjAyZDEzNjNhZjQ0OTMyYmFhNmY5Mw==
|
7
|
+
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZmMxN2JkYjZjMGFlZjYyNjUyMzM0MzUwNzhiMjJkY2IxMjliODE0YTkyMDE5
|
10
|
+
N2RlNGJmNDZjYjUwMDE4MjZjNTA4MzNjOTc0NjNhYzEyMDYzYTQ1ODM0MDM2
|
11
|
+
NjcwZTNkMjA0NTAyNWYxOTkwYjYyNWFmNDc4OWQ4ZGMzZWQ4ZTU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDZjMTgxNmNkYmVkMjk1MTg1OGVlNzg1ODRiYWZjZTkwOWY0MTY4ZDJkZTg0
|
14
|
+
NzczYTgxZjY3NzE5M2VmOWYwYzUwOGM3NDlkNjlkZWNhNjdmNzMyNGNkNzFh
|
15
|
+
MWU4ODkwMTFkMDI4YzY1NzRmNzdlZmViZWFmNDJlZDkzNTkxNWY=
|
data/bin/wti
CHANGED
@@ -88,7 +88,7 @@ EOS
|
|
88
88
|
end
|
89
89
|
when "init"
|
90
90
|
Trollop::options do
|
91
|
-
banner "wti init - Configure your project to sync"
|
91
|
+
banner "wti init [api_token] - Configure your project to sync"
|
92
92
|
opt :config, "Path to a configuration file", :short => "-c", :default => ".wti"
|
93
93
|
end
|
94
94
|
when "match"
|
data/history.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## Version 2.1.3 / 2013-04-25
|
2
|
+
|
3
|
+
* Display more information about “unavail” error message. #97
|
4
|
+
* New: add ability to initialize project with a one-liner: `wti init api_token`. #94
|
5
|
+
* Catch errors when running commands in a directory not containing a .wti file. #98
|
6
|
+
|
1
7
|
## Version 2.1.2 / 2013-04-20
|
2
8
|
|
3
9
|
* Update my name so it doesn’t contain accentuated characters anymore (seems to make jruby/rubygems 2.0.3 fail to install the gem). #96
|
@@ -166,8 +166,13 @@ module WebTranslateIt
|
|
166
166
|
|
167
167
|
def init
|
168
168
|
puts "# Initializing project"
|
169
|
-
|
170
|
-
|
169
|
+
if parameters.any?
|
170
|
+
api_key = parameters[0]
|
171
|
+
path = '.wti'
|
172
|
+
else
|
173
|
+
api_key = Util.ask(" Project API Key:")
|
174
|
+
path = Util.ask(" Path to configuration file:", '.wti')
|
175
|
+
end
|
171
176
|
FileUtils.mkpath(path.split('/')[0..path.split('/').size-2].join('/')) unless path.split('/').size == 1
|
172
177
|
project = YAML.load WebTranslateIt::Project.fetch_info(api_key)
|
173
178
|
project_info = project['project']
|
@@ -17,16 +17,21 @@ module WebTranslateIt
|
|
17
17
|
def initialize(root_path = Rails.root, path_to_config_file = ".wti")
|
18
18
|
self.path = root_path
|
19
19
|
self.logger = logger
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
20
|
+
if File.exists?(File.expand_path(path_to_config_file, self.path))
|
21
|
+
configuration = YAML.load_file(File.expand_path(path_to_config_file, self.path))
|
22
|
+
self.api_key = configuration['api_key']
|
23
|
+
self.before_pull = configuration['before_pull']
|
24
|
+
self.after_pull = configuration['after_pull']
|
25
|
+
self.before_push = configuration['before_push']
|
26
|
+
self.after_push = configuration['after_push']
|
27
|
+
project_info = YAML.load WebTranslateIt::Project.fetch_info(api_key)
|
28
|
+
set_locales_to_ignore(configuration)
|
29
|
+
set_files(project_info['project'])
|
30
|
+
set_locales(project_info['project'])
|
31
|
+
else
|
32
|
+
puts StringUtil.failure("\nCan't find a configuration file in #{File.expand_path(path_to_config_file, self.path)}")
|
33
|
+
exit(1)
|
34
|
+
end
|
30
35
|
end
|
31
36
|
|
32
37
|
# Set the project locales from the Project API.
|
@@ -36,7 +36,7 @@ module WebTranslateIt
|
|
36
36
|
return StringUtil.success("Created") if response.code.to_i == 201
|
37
37
|
return StringUtil.success("Accepted") if response.code.to_i == 202
|
38
38
|
return StringUtil.success("Not Modified") if response.code.to_i == 304
|
39
|
-
return StringUtil.failure("
|
39
|
+
return StringUtil.failure("Locked\n (another import in progress)") if response.code.to_i == 503
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
metadata
CHANGED
@@ -1,86 +1,86 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web_translate_it
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edouard Briere
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-04-
|
11
|
+
date: 2013-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multipart-post
|
15
|
-
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 1.2.0
|
20
|
-
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
21
23
|
requirements:
|
22
|
-
- -
|
24
|
+
- - ~>
|
23
25
|
- !ruby/object:Gem::Version
|
24
26
|
version: 1.2.0
|
25
|
-
prerelease: false
|
26
|
-
type: :runtime
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: trollop
|
29
|
-
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '2.0'
|
34
|
-
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
35
37
|
requirements:
|
36
|
-
- -
|
38
|
+
- - ~>
|
37
39
|
- !ruby/object:Gem::Version
|
38
40
|
version: '2.0'
|
39
|
-
prerelease: false
|
40
|
-
type: :runtime
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: multi_json
|
43
|
-
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ! '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
|
-
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
49
51
|
requirements:
|
50
|
-
- -
|
52
|
+
- - ! '>='
|
51
53
|
- !ruby/object:Gem::Version
|
52
54
|
version: '0'
|
53
|
-
prerelease: false
|
54
|
-
type: :runtime
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
|
-
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 2.6.0
|
62
|
-
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
63
65
|
requirements:
|
64
|
-
- -
|
66
|
+
- - ! '>='
|
65
67
|
- !ruby/object:Gem::Version
|
66
68
|
version: 2.6.0
|
67
|
-
prerelease: false
|
68
|
-
type: :development
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: guard-rspec
|
71
|
-
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ! '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
|
-
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
77
79
|
requirements:
|
78
|
-
- -
|
80
|
+
- - ! '>='
|
79
81
|
- !ruby/object:Gem::Version
|
80
82
|
version: '0'
|
81
|
-
|
82
|
-
type: :development
|
83
|
-
description:
|
83
|
+
description:
|
84
84
|
email: edouard@atelierconvivialite.com
|
85
85
|
executables:
|
86
86
|
- wti
|
@@ -93,7 +93,6 @@ files:
|
|
93
93
|
- license
|
94
94
|
- readme.md
|
95
95
|
- examples/locale.rb
|
96
|
-
- lib/web_translate_it.rb
|
97
96
|
- lib/web_translate_it/auto_fetch.rb
|
98
97
|
- lib/web_translate_it/cacert.pem
|
99
98
|
- lib/web_translate_it/command_line.rb
|
@@ -105,49 +104,50 @@ files:
|
|
105
104
|
- lib/web_translate_it/term_translation.rb
|
106
105
|
- lib/web_translate_it/translation.rb
|
107
106
|
- lib/web_translate_it/translation_file.rb
|
108
|
-
- lib/web_translate_it/util.rb
|
109
107
|
- lib/web_translate_it/util/array_util.rb
|
110
108
|
- lib/web_translate_it/util/hash_util.rb
|
111
109
|
- lib/web_translate_it/util/string_util.rb
|
112
|
-
-
|
110
|
+
- lib/web_translate_it/util.rb
|
111
|
+
- lib/web_translate_it.rb
|
113
112
|
- generators/webtranslateit/lib/insert_commands.rb
|
113
|
+
- generators/webtranslateit/webtranslateit_generator.rb
|
114
114
|
- bin/wti
|
115
115
|
- man/wti.1
|
116
116
|
- man/wti.1.html
|
117
117
|
- man/wti.1.ron
|
118
|
-
- spec/spec_helper.rb
|
119
|
-
- spec/examples/en.yml
|
120
118
|
- spec/examples/config/translation.yml
|
119
|
+
- spec/examples/en.yml
|
120
|
+
- spec/spec_helper.rb
|
121
121
|
- spec/web_translate_it/string_spec.rb
|
122
122
|
- spec/web_translate_it/term_spec.rb
|
123
123
|
homepage: https://webtranslateit.com
|
124
124
|
licenses: []
|
125
125
|
metadata: {}
|
126
|
-
post_install_message:
|
126
|
+
post_install_message:
|
127
127
|
rdoc_options:
|
128
|
-
-
|
128
|
+
- --main
|
129
129
|
- readme.md
|
130
130
|
require_paths:
|
131
131
|
- lib
|
132
132
|
required_ruby_version: !ruby/object:Gem::Requirement
|
133
133
|
requirements:
|
134
|
-
- -
|
134
|
+
- - ! '>='
|
135
135
|
- !ruby/object:Gem::Version
|
136
136
|
version: '0'
|
137
137
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
138
|
requirements:
|
139
|
-
- -
|
139
|
+
- - ! '>='
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
|
-
rubyforge_project:
|
143
|
+
rubyforge_project:
|
144
144
|
rubygems_version: 2.0.3
|
145
|
-
signing_key:
|
145
|
+
signing_key:
|
146
146
|
specification_version: 4
|
147
147
|
summary: A CLI to sync locale files with webtranslateit.com.
|
148
148
|
test_files:
|
149
|
-
- spec/spec_helper.rb
|
150
|
-
- spec/examples/en.yml
|
151
149
|
- spec/examples/config/translation.yml
|
150
|
+
- spec/examples/en.yml
|
151
|
+
- spec/spec_helper.rb
|
152
152
|
- spec/web_translate_it/string_spec.rb
|
153
153
|
- spec/web_translate_it/term_spec.rb
|