zci 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4eea0540a33e0202fa9e101513f810c6a0b86876
4
- data.tar.gz: 85b2d12ebf21a67e8d4072d3f3fdd5e4112a6b05
3
+ metadata.gz: 74c68016fb98385348c5b0a2b9fc52bdd58dfa66
4
+ data.tar.gz: 115756f78c28fddda64e0063acafcaaf040d774c
5
5
  SHA512:
6
- metadata.gz: 5ef8a9c8e013592a0940bf4e8989fc309faf84601d2bfbb958a58198c96ed4f3d7f034da93a8c039291f6f3a1d5e522866e1058abfe696a37b3559c23e4acd50
7
- data.tar.gz: dcc5a836e6a8147a83fec7f1a9350164ab91ba1b71be7311e6e7aba9e7049da47aed819713a81398c380e1b7108b1df99d47d23a2d7a971612c2c0316a3c3a60
6
+ metadata.gz: 51f091f825c13e88e02b77a04ee7597a315a04b6220141b0abd90462fecfeaecff0663bbdb05532a6bc99dad0852195b8b49eb69d64751ea59292b437497fe93
7
+ data.tar.gz: a7550fc239f3f23f5f04baf628329f57c6aa1eac74030acdac520173522004d802ade77f2771cf793e9a00d45a9d9433e0b71958225a7ab05dd04735aeef8d3d
data/Gemfile CHANGED
@@ -1,5 +1,5 @@
1
1
  source 'https://rubygems.org'
2
2
  gemspec
3
3
 
4
- gem 'byebug'
4
+ # gem 'byebug'
5
5
  # gem 'zendesk_help_center_api', path: '../zendesk_help_center_api_client_rb'
data/README.md CHANGED
@@ -46,7 +46,7 @@ SYNOPSIS
46
46
  zci [global options] command [command options] [arguments...]
47
47
 
48
48
  VERSION
49
- 0.2.0
49
+ 0.3.1
50
50
 
51
51
  GLOBAL OPTIONS
52
52
  -c, --config=<s> - Project-specific configuration file (default: /home/crowdin/zci.yml)
@@ -60,6 +60,7 @@ COMMANDS
60
60
  import:sources - Read categories/section/articles from Zendesk and upload resource files to Crowdin
61
61
  download:translations - Build and download translation resources from Crowdin
62
62
  export:translations - Add or update localized resource files(categories, sections and articles) in Zendesk
63
+ project:info - Zendesk and Crowdin info
63
64
  ```
64
65
 
65
66
  ## Configuration
@@ -102,8 +103,8 @@ categories:
102
103
 
103
104
  Tested with the following Ruby versions:
104
105
 
105
- - MRI 2.2.3
106
- - JRuby 9.0.0.0
106
+ - MRI 2.2.3 (Windows)
107
+ - MRI 2.4.1 (Linux/macOS)
107
108
 
108
109
  ## Contributing
109
110
 
data/bin/zci CHANGED
@@ -56,6 +56,8 @@ pre do |global, command, options, args|
56
56
  require 'logger'
57
57
  config.logger = Logger.new(STDOUT)
58
58
  end
59
+
60
+ config.client_options = {ssl: {verify: false}}
59
61
  end
60
62
 
61
63
  if global[:verbose]
data/lib/zci.rb CHANGED
@@ -6,6 +6,7 @@ require 'zendesk_api/help_center'
6
6
  require 'crowdin-api'
7
7
  require 'nokogiri'
8
8
  require 'zip'
9
+ # require 'byebug'
9
10
 
10
11
  # Add requires for other files you add to your project here, so
11
12
  # you just need to require this one file in your bin file
@@ -8,11 +8,23 @@ command :'export:translations' do |c|
8
8
  c.arg_name 'dir'
9
9
  c.flag [:resources_dir]
10
10
 
11
+ c.desc 'Defines what language upload translations to. By default translations will be uploaded for all languages'
12
+ c.default_value 'all'
13
+ c.arg_name 'language_code'
14
+ c.flag [:l, :language]
15
+
11
16
  c.action do |global_options, options, args|
12
17
  resources_dir = File.join(File.dirname(global_options[:config]), options[:resources_dir])
18
+ language = options[:language]
19
+
20
+ if language == 'all'
21
+ zendesk_locales = @zendesk.locales
22
+ else
23
+ zendesk_locales = @zendesk.locales.select { |locale| locale.locale == language }
24
+ end
13
25
 
14
26
  @cli_config['categories'].each do |category|
15
- @zendesk.locales.select { |locale| !locale.default? }.each do |locale|
27
+ zendesk_locales.select { |locale| !locale.default? }.each do |locale|
16
28
  if lang = category['translations'].detect { |tr| tr['zendesk_locale'].casecmp(locale.locale) == 0 }
17
29
  category_xml_files = Dir["#{resources_dir}/#{lang['crowdin_language_code']}/#{category['zendesk_category']}/category_*.xml"]
18
30
  section_xml_files = Dir["#{resources_dir}/#{lang['crowdin_language_code']}/#{category['zendesk_category']}/section_*.xml"]
@@ -102,7 +114,7 @@ command :'export:translations' do |c|
102
114
  end
103
115
 
104
116
  end
105
- end # @zendesk.locales
117
+ end # zendesk_locales
106
118
  end # @cli_config['categories'].each
107
119
  end
108
120
  end
data/lib/zci/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module ZCI
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Maminov