deplomat 0.2.16 → 0.2.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c80211d4c464c085f43b19d2a27f2b82d5e066c1dc31b92caa5d2cf874353dc4
4
- data.tar.gz: d53d94174f430d4331beaa60410cc0e404a279ed3d5ed3994ed7ff39b403b46e
3
+ metadata.gz: 130af62ec011d711d41ccfb523dcda9c87c6aacb8efafbf20ab1df6e36c8bc7c
4
+ data.tar.gz: a069983f8e50be5738e33f970e5772e1ec25fdd8e5b0bb6012ecb4d0afef656e
5
5
  SHA512:
6
- metadata.gz: aee786c6a683d0ba765f8288c8eda00c50d7cee11451a669262d42d740592fed3ebb3da442466d2e27a282b63a466c24eed09d2dc52c72168d28d66e9ed2f16a
7
- data.tar.gz: b6b96a6b4889bd2243140c3429d59e88499ed1e1981ffc737d883a02df89f95d7b91dfe088ae8c17a21aa2f109cab92034b5ace88bee0d59b3819eff9ca7b4c5
6
+ metadata.gz: 15ca99d10804a02ad67d3e1f1290de66502ddcc5fbe2fae3886a797857c8243acdb3c6359879ac0586663fbf2699b72b787252856667c30e5d68c66b420f50b5
7
+ data.tar.gz: a2403c6aa57719bcd56afdbe23d51782687066815edb4dabac69c4a16d910665a5ec49e077d6e361720461fd02142c5e0d6aeca74a11892d3ccdc1092fd28bf5
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- deplomat (0.2.16)
4
+ deplomat (0.2.17)
5
5
  colorize
6
6
  sys-proctable
7
7
 
@@ -10,7 +10,7 @@ GEM
10
10
  specs:
11
11
  colorize (0.8.1)
12
12
  diff-lcs (1.3)
13
- ffi (1.13.1)
13
+ ffi (1.14.1)
14
14
  rspec (3.8.0)
15
15
  rspec-core (~> 3.8.0)
16
16
  rspec-expectations (~> 3.8.0)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.16
1
+ 0.2.17
@@ -1,6 +1,7 @@
1
1
  $partials = {}
2
2
  $deplomat_tasks = []
3
3
  $deplomat_tasks_callbacks = {}
4
+ $log_tasks_status = true
4
5
 
5
6
  def execute_in(env:)
6
7
  yield if $env == env
@@ -26,6 +27,10 @@ def print_to_terminal(message, color: nil, newline: true)
26
27
  $stdout.print message
27
28
  end
28
29
 
30
+ def print_task_status(name, status)
31
+ print_to_terminal("\n--- #{name} task #{status.upcase}", color: :light_blue, newline: true)
32
+ end
33
+
29
34
  # This wrapper allows us to insert external before/after
30
35
  # tasks into every method executed by deplomat.
31
36
  # Very useful for the one-time-tasks implementation.
@@ -37,13 +42,15 @@ alias :add_tasks :add_task
37
42
  def before_task(task_name, requisite_number, &block)
38
43
  $deplomat_tasks_callbacks[task_name] ||= {}
39
44
  $deplomat_tasks_callbacks[task_name][:before] ||= []
40
- $deplomat_tasks_callbacks[task_name][:before] << lambda { block.call; update_requisite_number!(requisite_number) }
45
+ ($deplomat_tasks_callbacks[task_name][:before] << lambda { print_task_status(task_name, "started") }) if $log_tasks_status
46
+ $deplomat_tasks_callbacks[task_name][:before] << lambda { block.call; update_requisite_number!(requisite_number) }
41
47
  end
42
48
 
43
49
  def after_task(task_name, requisite_number, &block)
44
50
  $deplomat_tasks_callbacks[task_name] ||= {}
45
51
  $deplomat_tasks_callbacks[task_name][:after] ||= []
46
- $deplomat_tasks_callbacks[task_name][:after] << lambda { block.call; update_requisite_number!(requisite_number) }
52
+ ($deplomat_tasks_callbacks[task_name][:after] << lambda { print_task_status(task_name, "finished") }) if $log_tasks_status
53
+ $deplomat_tasks_callbacks[task_name][:after] << lambda { block.call; update_requisite_number!(requisite_number) }
47
54
  end
48
55
 
49
56
  def execute_tasks!
@@ -13,8 +13,9 @@ module Deplomat
13
13
  end.compact
14
14
  end
15
15
 
16
- def initialize(logfile: "#{Dir.pwd}/deplomat.log", log_to: [:stdout], path: nil, raise_exceptions: true)
16
+ def initialize(logfile: "#{Dir.pwd}/deplomat.log", log_to: [:stdout], path: nil, log_tasks_status: true, raise_exceptions: true)
17
17
  @log_to = log_to
18
+ @log_tasks_status = log_tasks_status
18
19
  @logfile = logfile
19
20
  @raise_exceptions = raise_exceptions
20
21
  @current_path = path.sub(/\/+\Z/, '') if !path.nil? && path_exist?(path)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deplomat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.16
4
+ version: 0.2.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - romanitup
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-14 00:00:00.000000000 Z
11
+ date: 2020-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize