zci 0.0.2 → 0.0.3
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/.ruby-version +1 -1
- data/README.md +5 -5
- data/lib/zci/commands/01_init.rb +1 -1
- data/lib/zci/commands/02_import.rb +4 -4
- data/lib/zci/commands/03_download.rb +1 -1
- data/lib/zci/import.rb +4 -0
- data/lib/zci/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bac2e0338648d66c14665b57a42a1bed7a0f14e
|
4
|
+
data.tar.gz: 111f98adbc1eaead681810163e70b898da33d626
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed09e352493f2368c1d441e92b689a6dce98e7d1bd7c5a3e4ff141fe286aa69ccf27f633b9b740d52146124825ebd565987263f84735bbcc0c70ac1998309a6d
|
7
|
+
data.tar.gz: 2c60c5647e53a75a8402233f6da718386c3179669d0ec2a372245de8c31ecc53d1ea1b4b67654b97d31213de03a23c624ff612ef0bd1d40b2c5333a0f6e50069
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby
|
1
|
+
ruby
|
data/README.md
CHANGED
@@ -29,7 +29,7 @@ The simplest way to get started is to create a scaffold project:
|
|
29
29
|
> zci init todo
|
30
30
|
```
|
31
31
|
|
32
|
-
A new ./todo directory is created
|
32
|
+
A new ./todo directory is created with the sample config `zci.yml`. View the basic output of the scaffold with:
|
33
33
|
|
34
34
|
```
|
35
35
|
> cd todo
|
@@ -46,19 +46,19 @@ SYNOPSIS
|
|
46
46
|
zci [global options] command [command options] [arguments...]
|
47
47
|
|
48
48
|
VERSION
|
49
|
-
0.0.
|
49
|
+
0.0.2
|
50
50
|
|
51
51
|
GLOBAL OPTIONS
|
52
|
-
-c, --config=<s> - Project-specific configuration file (default: /home/user/
|
52
|
+
-c, --config=<s> - Project-specific configuration file (default: /home/user/project/zci.yml)
|
53
53
|
--version - Display the program version
|
54
54
|
-v, --verbose - Be verbose
|
55
55
|
--help - Show this message
|
56
56
|
|
57
57
|
COMMANDS
|
58
58
|
help - Shows a list of commands or help for one command
|
59
|
-
init:project - Create
|
59
|
+
init:project - Create new ZCI-based project
|
60
60
|
import:sources - Read categories/section/articles from Zendesk and upload resource files to Crowdin
|
61
|
-
download:translations - Build and download
|
61
|
+
download:translations - Build and download translation resources from Crowdin
|
62
62
|
export:translations - Add or update localized resource files(sections and articles) in Zendesk
|
63
63
|
```
|
64
64
|
|
data/lib/zci/commands/01_init.rb
CHANGED
@@ -84,10 +84,10 @@ command :'import:sources' do |c|
|
|
84
84
|
]
|
85
85
|
|
86
86
|
if remote_project_tree[:files].include?("/#{source_category_id}/#{file_name}")
|
87
|
-
puts "[Crowdin] Update file `#{file_name}`"
|
87
|
+
puts "[Crowdin] Update section file `#{file_name}`"
|
88
88
|
@crowdin.update_file(files, type: 'webxml')
|
89
89
|
else
|
90
|
-
puts "[Crowdin] Add file `#{file_name}`"
|
90
|
+
puts "[Crowdin] Add section file `#{file_name}`"
|
91
91
|
@crowdin.add_file(files, type: 'webxml')
|
92
92
|
end
|
93
93
|
end
|
@@ -110,10 +110,10 @@ command :'import:sources' do |c|
|
|
110
110
|
]
|
111
111
|
|
112
112
|
if remote_project_tree[:files].include?("/#{source_category_id}/#{file_name}")
|
113
|
-
puts "[Crowdin] Update file `#{file_name}`"
|
113
|
+
puts "[Crowdin] Update article file `#{file_name}`"
|
114
114
|
@crowdin.update_file(files, type: 'webxml')
|
115
115
|
else
|
116
|
-
puts "[Crowdin] Add file `#{file_name}`"
|
116
|
+
puts "[Crowdin] Add article file `#{file_name}`"
|
117
117
|
@crowdin.add_file(files, type: 'webxml')
|
118
118
|
|
119
119
|
end
|
data/lib/zci/import.rb
CHANGED
@@ -29,6 +29,10 @@ module ZCI
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def build_article_xml(article)
|
32
|
+
# remove control chars, unicode codepoints from 0001 to 001A
|
33
|
+
article.title.gsub!(/[\u0001-\u001A]/ , '')
|
34
|
+
article.body.gsub!(/[\u0001-\u001A]/ , '')
|
35
|
+
|
32
36
|
article_xml = Nokogiri::XML::Builder.new do |xml|
|
33
37
|
xml.root {
|
34
38
|
# id - id of the original acticle
|
data/lib/zci/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zci
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Maminov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -203,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
203
203
|
version: '0'
|
204
204
|
requirements: []
|
205
205
|
rubyforge_project:
|
206
|
-
rubygems_version: 2.4.
|
206
|
+
rubygems_version: 2.4.8
|
207
207
|
signing_key:
|
208
208
|
specification_version: 4
|
209
209
|
summary: Zendesk and Crowdin integration Command Line Interface (CLI)
|