zci 0.0.1 → 0.0.2

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: 4fb7673acae1967d9772186d2997a792219bf996
4
- data.tar.gz: 7ff6daca96e2fd78ebebc4da556bac1fdc01dc42
3
+ metadata.gz: e64255b9f9cf12d6427bd07d7971eb173698d031
4
+ data.tar.gz: 331837a46c7d85598a6a58215da68d4a8243dc46
5
5
  SHA512:
6
- metadata.gz: a277fb3302cde662f210b296a7e49e5df1d007130b02cb5c5e445e1f4cd8e0bdb3747bfac08220603060bf99c4e01eaf005533cd5deba5bcc279cb52ae30a08e
7
- data.tar.gz: 2c1cb1046cb17af46a71b23caf6c90c5277aefab0f3608d0d4a7eba1399f13e5f3fb97324631977ca17439fa73a6e4dd45c4328ce5abfc5351017148db8635e1
6
+ metadata.gz: 26da2d4cb8733f663e5398091d9cc708dc66479e14abf3a144fbfe47c1db8a715e132c5cce74a32d7b48de7f1d512b545ab089e10f9fc6fa7c86fd65420619d3
7
+ data.tar.gz: 1d08b2465ff2ba17c1e3683abd04182b66650799776fc193a49aa909d64fa58ba0967349c0821c3c1ed0560392ff9572479a47619fcc3247d08e458b844a4f82
data/bin/zci CHANGED
@@ -59,7 +59,7 @@ pre do |global, command, options, args|
59
59
  end
60
60
 
61
61
  if global[:verbose]
62
- Crowdin::API.log = Logger.new(STDOUT) if globals[:verbose]
62
+ Crowdin::API.log = Logger.new(STDOUT) if global[:verbose]
63
63
  end
64
64
 
65
65
  @crowdin = Crowdin::API.new(api_key: @cli_config['crowdin_api_key'], project_id: @cli_config['crowdin_project_id'], base_url: @cli_config['crowdin_base_url'])
File without changes
@@ -40,13 +40,15 @@ command :'export:translations' do |c|
40
40
  all_sections.each do |section_hash|
41
41
  if section = sections.find(id: section_hash[:id])
42
42
  if section_tr = section.translations.detect { |tr| tr.locale == locale.locale }
43
- puts "[Zendesk] Update `#{lang['crowdin_language_code']}` language translation for Section\##{section.id}."
44
- section_tr = section_tr.update(name: section_hash[:name], description: section_hash[:description])
45
- section_tr.save
43
+ section_tr.update(name: section_hash[:name], description: section_hash[:description])
44
+ if section_tr.changed?
45
+ section_tr.save
46
+ puts "[Zendesk] Update `#{lang['crowdin_language_code']}` language translation for Section\##{section.id}."
47
+ end
46
48
  else
47
- puts "[Zendesk] Create `#{lang['crowdin_language_code']}` language translation for Section\##{section.id}."
48
49
  section_tr = section.translations.build(locale: locale.locale, name: section_hash[:name], description: section_hash[:description])
49
50
  section_tr.save
51
+ puts "[Zendesk] Create `#{lang['crowdin_language_code']}` language translation for Section\##{section.id}."
50
52
  end
51
53
  end
52
54
  end
@@ -57,13 +59,15 @@ command :'export:translations' do |c|
57
59
  if section = sections.find(id: article_hash[:section_id])
58
60
  if article = section.articles.find(id: article_hash[:id])
59
61
  if article_tr = article.translations.detect { |tr| tr.locale == locale.locale }
60
- puts "[Zendesk] Update `#{lang['crowdin_language_code']}` language translation for Article\##{article.id}."
61
- article_tr = article_tr.update(title: article_hash[:title], body: article_hash[:body])
62
- article_tr.save
62
+ article_tr.update(title: article_hash[:title], body: article_hash[:body])
63
+ if article_tr.changed?
64
+ article_tr.save
65
+ puts "[Zendesk] Update `#{lang['crowdin_language_code']}` language translation for Article\##{article.id}."
66
+ end
63
67
  else
64
- puts "[Zendesk] Create `#{lang['crowdin_language_code']}` language translation for Article\##{article.id}."
65
68
  article_tr = article.translations.build(locale: locale.locale, title: article_hash[:title], body: article_hash[:body])
66
69
  article_tr.save
70
+ puts "[Zendesk] Create `#{lang['crowdin_language_code']}` language translation for Article\##{article.id}."
67
71
  end
68
72
  end
69
73
  end
data/lib/zci/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module ZCI
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
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.1
4
+ version: 0.0.2
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-05-29 00:00:00.000000000 Z
11
+ date: 2015-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -165,9 +165,9 @@ files:
165
165
  - README.md
166
166
  - Rakefile
167
167
  - bin/zci
168
- - features/fci.feature
169
- - features/step_definitions/fci_steps.rb
168
+ - features/step_definitions/zci_steps.rb
170
169
  - features/support/env.rb
170
+ - features/zci.feature
171
171
  - lib/zci.rb
172
172
  - lib/zci/commands/01_init.rb
173
173
  - lib/zci/commands/02_import.rb