docman 0.0.106 → 0.0.107

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: 58e717eda33ee516248d544410e24b5c6014d6c3f90c1ae1e9cdcb5d500f8185
4
- data.tar.gz: eb053c923cd1b06c4df718ae5d9f44cfaf637404db8ea0561ad19137d7f66d07
3
+ metadata.gz: bc6b3416258a76e5e50ba333286140bbc1a033804e6b3814e0268ae1b5ecfa12
4
+ data.tar.gz: 9915e6a119f30316bc32114de05c5ef1ec179d83f39626f42ad2351cbe946f01
5
5
  SHA512:
6
- metadata.gz: b09e54c075b5cd65694c60362a502111f2d6e2c151eedd360f6fd1eea4263c4a46fb7310a2a61c295eea800cd8127adea366fac666c602242515743993dd96df
7
- data.tar.gz: 68425ed7d28edcd65dd36d9d3d73c2950a56746f9cc4cabf93e2872c76e55355ee5edddd87a2953718739edb3ce77c97527e49e5cab7aaf731a26034a4db75cb
6
+ metadata.gz: 840133302ae7401ce8530ba5ca530e7fcb8e290839b46631dcaf7575775041ae41027477f9c85d295b8ef2b3d35fce579abb482f55b677c208a33e04aed95e89
7
+ data.tar.gz: f2998e8c4b90cb901e9469c06f7e69c2ab8553f3633ff41eb95ca9f8cddb0fd7e1d85400cd6f3e30738998f0b59c37623b30366e0bb1afd44f208da9799fa0f2
@@ -9,10 +9,50 @@ module Docman
9
9
  end
10
10
 
11
11
  def build_with_provider
12
- `find #{@context['full_build_path']} -mindepth 1 -maxdepth 1 -not -name '.git' -exec rm -rf {} \\;` if File.directory? @context['full_build_path']
13
- FileUtils.rm_r self['target_path'] if @context.need_rebuild? and File.directory? self['target_path']
14
- result = @provider.perform
15
- `rsync -a --exclude '.git' #{self['target_path']}/. #{@context['full_build_path']}`
12
+ docman_ignore_var = "DOCMAN_IGNORE"
13
+ if ENV.has_key? docman_ignore_var and ENV[docman_ignore_var].length > 0
14
+ puts "Variable #{docman_ignore_var} => #{ENV[docman_ignore_var]}. Use ignore workflow."
15
+
16
+ ignore = ['.git']
17
+ ignore_value = ENV[docman_ignore_var]
18
+ ignore_array = ignore_value.split(":")
19
+ ignore_array.each do |item|
20
+ ignore.push(item)
21
+ end
22
+ ignore.uniq!
23
+
24
+ find_ignore_array = []
25
+ ignore.each do |item|
26
+ find_ignore_array.push("^#{File.join(@context['full_build_path'], item).gsub('.', '\.')}/.*$")
27
+ path = ''
28
+ item.split("/").each do |part|
29
+ path = File.join(path, part)
30
+ find_ignore_array.push("^#{File.join(@context['full_build_path'], path).gsub('.', '\.')}$")
31
+ end
32
+ end
33
+ find_ignore = "-e \"#{find_ignore_array.join("\" -e \"")}\""
34
+
35
+ puts "FIND IGNORE => #{find_ignore}"
36
+ `find #{@context['full_build_path']} -mindepth 1 -print0 | grep -z -v #{find_ignore} | xargs -0 -r -t rm -rf` if File.directory? @context['full_build_path']
37
+ FileUtils.rm_r self['target_path'] if @context.need_rebuild? and File.directory? self['target_path']
38
+
39
+ result = @provider.perform
40
+
41
+ rsync_ignore_array = ignore.each do |item|
42
+ "--exclude \"#{item}\""
43
+ end
44
+ rsync_ignore = "--exclude=\"/#{rsync_ignore_array.join("\" --exclude=\"/")}\""
45
+
46
+ puts "RSYNC IGNORE => #{rsync_ignore}"
47
+ `rsync -a #{rsync_ignore} #{self['target_path']}/. #{@context['full_build_path']}`
48
+ else
49
+ puts "Variable #{docman_ignore_var} not found. Use standard workflow."
50
+ `find #{@context['full_build_path']} -mindepth 1 -maxdepth 1 -not -name '.git' -exec rm -rf {} \\;` if File.directory? @context['full_build_path']
51
+ FileUtils.rm_r self['target_path'] if @context.need_rebuild? and File.directory? self['target_path']
52
+ result = @provider.perform
53
+ `rsync -a --exclude '.git' #{self['target_path']}/. #{@context['full_build_path']}`
54
+ end
55
+
16
56
  result
17
57
  end
18
58
 
@@ -1,3 +1,3 @@
1
1
  module Docman
2
- VERSION = "0.0.106"
2
+ VERSION = "0.0.107"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.106
4
+ version: 0.0.107
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Tolstikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-01 00:00:00.000000000 Z
11
+ date: 2019-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler