docman 0.0.84 → 0.0.85

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: 80578901d1ae0de8b772d64bc2fc60377efd4c79
4
- data.tar.gz: b3a0a76aaea7b08d1b65d176ee592a2e5d9890df
3
+ metadata.gz: 70c7c3f2b86000da6bcba2c94d22aeabe5f0d433
4
+ data.tar.gz: 0dc6785c2f831f4b75b3133c9050797ddd1bd9b7
5
5
  SHA512:
6
- metadata.gz: f31180892abc6e90eb00e16647fc2ea7b927aba9c68d3836aded44e9dffd8c1d5f62edff882d7510a1e6978089f0c70fa88fca9212fd881f3d1e9987452d3fc0
7
- data.tar.gz: '0380ad7bc61bf16e81b4a1b4127d0790e9b1bab8c23d17dbf534fe59f53adaa5f91c6311e4741b5d6f0047b9370890b163733492205e51d6e2823e8f9da74b51'
6
+ metadata.gz: f4a890537942e8ea538ffd701615dad86fd9fbedc5f54cbfd28a7d75afa1da80a6e9f8b4aaa91f72340c8376d6f48216c93db076b56f82ba7fd5bb65909d9154
7
+ data.tar.gz: 4356556f737aaf1c98d0be54ec61c2beed20c2cded3c803a099b4468ca3a159c75f1528f2b359472a1b1edb96ee65b4301a3af435011cebca6b4c89b1d346dec
data/lib/application.rb CHANGED
@@ -66,7 +66,7 @@ module Docman
66
66
  def with_rescue(write_to_file = true)
67
67
  failed_filepath = File.join(@workspace_dir, 'failed')
68
68
  if File.file?(failed_filepath)
69
- log 'Last operation failed, forced rebuild mode'
69
+ puts 'Last operation failed, forced rebuild mode'
70
70
  FileUtils.rm_f failed_filepath
71
71
  @force = true
72
72
  end
data/lib/docman/cli.rb CHANGED
@@ -10,6 +10,7 @@ module Docman
10
10
 
11
11
  desc 'init "dirname" "repo"', 'Initialize docroot in "dirname" from config repo "repo"'
12
12
  method_option :force, :aliases => '-f', :desc => 'Force init'
13
+ method_option :debug, :aliases => '-d', :desc => 'Debug'
13
14
  method_option :skip, :aliases => '-s', :desc => 'Skip if docroot initialized already'
14
15
  option :branch
15
16
  def init(name, repo)
@@ -40,6 +41,7 @@ module Docman
40
41
 
41
42
  desc 'build', 'Build docroot'
42
43
  method_option :force, :aliases => '-f', :desc => 'Force full rebuild'
44
+ method_option :debug, :aliases => '-d', :desc => 'Debug'
43
45
  method_option :config, :desc => 'Configuration override JSON'
44
46
  method_option :config_dir, :desc => 'Config directories divided by coma where docman will search for config.yaml'
45
47
  option :tag
@@ -54,6 +56,7 @@ module Docman
54
56
 
55
57
  desc 'deploy', 'Deploy to target'
56
58
  method_option :force, :aliases => '-f', :desc => 'Force full deploy'
59
+ method_option :debug, :aliases => '-d', :desc => 'Debug'
57
60
  method_option :config, :desc => 'Configuration override JSON'
58
61
  method_option :config_dir, :desc => 'Config directories divided by coma where docman will search for config.yaml'
59
62
  def deploy(deploy_target, name, type, version)
@@ -99,6 +102,7 @@ module Docman
99
102
 
100
103
  desc 'info', 'Get info'
101
104
  method_option :force, :aliases => '-f', :desc => 'Force full rebuild'
105
+ method_option :debug, :aliases => '-d', :desc => 'Debug'
102
106
  method_option :config_dir, :desc => 'Config directories divided by coma where docman will search for config.yaml'
103
107
  option :tag
104
108
  def info(command, file)
@@ -83,7 +83,7 @@ module Docman
83
83
  else
84
84
  log 'No changes in docroot', 'info'
85
85
  end
86
- log "Deploy results:\n" + @build_results.to_yaml
86
+ log "Deploy results:\n" + @build_results.to_yaml, 'info'
87
87
  end
88
88
 
89
89
  def deploy
@@ -19,14 +19,20 @@ module Docman
19
19
  def self.squash_commits(commit_count, message = nil)
20
20
  message = "$(git log --format=%B --reverse HEAD..HEAD@{1})" unless message
21
21
  exec "reset --soft HEAD~#{commit_count}"
22
- exec "commit --no-verify -m \"#{message}\""
22
+ if Application::instance.options.has_key?('debug')
23
+ exec "commit --no-verify -m \"#{message}\""
24
+ else
25
+ exec "commit --quiet --no-verify -m \"#{message}\""
26
+ end
23
27
  end
24
28
 
25
29
  def self.reset_repo(path)
26
30
  Dir.chdir path
27
31
  exec 'reset --hard'
28
- exec 'clean -f -d -x --dry-run'
29
- exec 'status'
32
+ if Application::instance.options.has_key?('debug')
33
+ exec 'clean -f -d -x --dry-run'
34
+ exec 'status'
35
+ end
30
36
  exec 'clean -f -d -x'
31
37
  end
32
38
 
@@ -86,7 +92,14 @@ module Docman
86
92
  # pull root_path
87
93
  Dir.chdir root_path
88
94
  exec %Q(add --all #{path.slice "#{root_path}/"})
89
- exec %Q(commit --no-verify -m "#{message}") if repo_changed? path
95
+ if repo_changed? path
96
+ if Application::instance.options.has_key?('debug')
97
+ exec %Q(commit --no-verify -m "#{message}")
98
+ else
99
+ exec %Q(commit --quiet --no-verify -m "#{message}")
100
+ end
101
+ end
102
+
90
103
  self.tag(root_path, tag) if tag
91
104
  Docman::Application.instance.commit_count = Docman::Application.instance.commit_count + 1
92
105
  end
@@ -31,7 +31,13 @@ module Docman
31
31
  end
32
32
 
33
33
  def log(message, type = 'debug')
34
- logger.send(type, "#{prefix} - #{message}")
34
+ if type == 'debug'
35
+ if Application::instance.options.has_key?('debug')
36
+ logger.send(type, "#{prefix} - #{message}")
37
+ end
38
+ else
39
+ logger.send(type, "#{prefix} - #{message}")
40
+ end
35
41
  end
36
42
 
37
43
  def prefix
@@ -1,3 +1,3 @@
1
1
  module Docman
2
- VERSION = "0.0.84"
2
+ VERSION = "0.0.85"
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.84
4
+ version: 0.0.85
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Tolstikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-06 00:00:00.000000000 Z
11
+ date: 2017-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler