zci 0.5.0 → 0.6.0

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
  SHA256:
3
- metadata.gz: d032d53cdb29d566c82c1fa1e9baa0b612c3a00c7f2d319ab54a5c441d2a4b68
4
- data.tar.gz: 6a83c172726b3b6c21fc49349cc1d3dadac0d1e20a949afaf35b426ac6b89200
3
+ metadata.gz: e20f9739b7e523668685961dad179855cb9d0ef0bc7c32cbf36a86c1c7d97a92
4
+ data.tar.gz: bdd23d6acd0b700cbb5aa85871b516d1e126497c0f7c809468b630b5e8ca30ba
5
5
  SHA512:
6
- metadata.gz: d7567a0660485cb0477c3b008b596b5937f2658e06430b32af14192ab7a602f4f5f1cdc5b168d842a1d740b2dda7dabbed0b9f4b8172673da98fd8a80edd70eb
7
- data.tar.gz: a279ef3ede31bc3647e42ffc68c8e9db81e3355b1c2b532de5f3d180e6264c5fa020aecbfe59b647f83fbd229839d1e4d59ccc8bb567871e6aed5746240f8f80
6
+ metadata.gz: 4e5af199d8cc39be27f79767f83439984294857cd69301dfe0a6ce3e4911bbfb898b72bfdc8eb466436da4358006d8fe5ae71e50ac9d3dbe129b27709ba2059b
7
+ data.tar.gz: '008a756e21bb2e9d00c4fcfedadb636e32f2eeecc5cd8c94b946f11d458caac6b0838b121aed85bf7c1ee9c21778caf8e7707c5ff980a2fd6c3ad48dad3ac0ee'
data/README.md CHANGED
@@ -47,7 +47,7 @@ SYNOPSIS
47
47
  zci [global options] command [command options] [arguments...]
48
48
 
49
49
  VERSION
50
- 0.5.0
50
+ 0.6.0
51
51
 
52
52
  GLOBAL OPTIONS
53
53
  -c, --config=<s> - Project-specific configuration file (default: /home/crowdin/zci.yml)
@@ -61,6 +61,7 @@ COMMANDS
61
61
  import:sources - Read categories/section/articles from Zendesk and upload resource files to Crowdin
62
62
  download:translations - Build and download translation resources from Crowdin
63
63
  export:translations - Add or update localized resource files(categories, sections and articles) in Zendesk
64
+ clean - Clears out the local repository of retrieved files
64
65
  project:info - Zendesk and Crowdin info
65
66
  ```
66
67
 
data/lib/zci.rb CHANGED
@@ -10,8 +10,9 @@ require 'zip'
10
10
 
11
11
  # Add requires for other files you add to your project here, so
12
12
  # you just need to require this one file in your bin file
13
- require 'zci/helpers.rb'
14
- require 'zci/init.rb'
15
- require 'zci/import.rb'
16
- require 'zci/download.rb'
17
- require 'zci/export.rb'
13
+ require_relative 'zci/helpers'
14
+ require_relative 'zci/init'
15
+ require_relative 'zci/import'
16
+ require_relative 'zci/download'
17
+ require_relative 'zci/export'
18
+ require_relative 'zci/clean'
@@ -0,0 +1,20 @@
1
+ module ZCI
2
+ def remove_dir(path)
3
+ if File.exists?(path)
4
+ if File.directory?(path)
5
+ Dir.foreach(path) do |file|
6
+ if (file.to_s != ".") && (file.to_s != "..")
7
+ remove_dir("#{path}/#{file}")
8
+ end
9
+ end
10
+ puts "Del `#{path}`"
11
+ Dir.delete(path)
12
+ else
13
+ puts "Del `#{path}`"
14
+ File.delete(path)
15
+ end
16
+ else
17
+ puts "No such directory - `#{path}`"
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,13 @@
1
+ desc 'Clears out the local repository of retrieved files'
2
+ command :'clean' do |c|
3
+ c.default_value 'resources'
4
+ c.arg_name 'dir'
5
+ c.flag [:resources_dir]
6
+
7
+ c.action do |global_options, options, args|
8
+ puts "Reading state information... Done"
9
+ resources_dir = File.join(File.dirname(global_options[:config]), options[:resources_dir])
10
+
11
+ remove_dir(resources_dir)
12
+ end
13
+ end
@@ -27,5 +27,4 @@ module ZCI
27
27
  end
28
28
  end
29
29
  end
30
-
31
30
  end
@@ -1,3 +1,3 @@
1
1
  module ZCI
2
- VERSION = '0.5.0'
2
+ VERSION = '0.6.0'
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.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Maminov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-15 00:00:00.000000000 Z
11
+ date: 2019-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -140,11 +140,13 @@ files:
140
140
  - features/support/env.rb
141
141
  - features/zci.feature
142
142
  - lib/zci.rb
143
+ - lib/zci/clean.rb
143
144
  - lib/zci/commands/01_init.rb
144
145
  - lib/zci/commands/02_import.rb
145
146
  - lib/zci/commands/03_download.rb
146
147
  - lib/zci/commands/04_export.rb
147
- - lib/zci/commands/05_info.rb
148
+ - lib/zci/commands/05_clean.rb
149
+ - lib/zci/commands/06_info.rb
148
150
  - lib/zci/download.rb
149
151
  - lib/zci/export.rb
150
152
  - lib/zci/helpers.rb