chef-apply 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -6
- data/lib/chef_apply/ui/terminal.rb +13 -1
- data/lib/chef_apply/version.rb +1 -1
- data/spec/unit/ui/terminal_spec.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11e436ae814ec9510c2a984a971cbe7854314eb79c0ab08aeac72fcba2858e18
|
4
|
+
data.tar.gz: f3ecae1562b74d61990aba202af58a8e3a39061308e40539ade9d4b1c8e71aaf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb0ce1d7c7657f99623d1f3e088f6d0ea7985b90df3fe3893a483e81cbcb8507b66d21db333d65c23a16571809e24fd669a8f45347296917d97cce54000de2d8
|
7
|
+
data.tar.gz: 60ebda06d54c11d8cd70f1e2d062fdc2276cd56d4f9ee4633eaada392981c03163fe96541ed14888c789fd0690f566b2016241319f89248534f78c17c86849af
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
chef-apply (0.2.
|
4
|
+
chef-apply (0.2.1)
|
5
5
|
chef (>= 14.0)
|
6
6
|
chef-dk (>= 3.0)
|
7
7
|
chef-telemetry
|
@@ -21,13 +21,13 @@ GEM
|
|
21
21
|
addressable (2.5.2)
|
22
22
|
public_suffix (>= 2.0.2, < 4.0)
|
23
23
|
ast (2.4.0)
|
24
|
-
aws-sdk (2.11.
|
25
|
-
aws-sdk-resources (= 2.11.
|
26
|
-
aws-sdk-core (2.11.
|
24
|
+
aws-sdk (2.11.151)
|
25
|
+
aws-sdk-resources (= 2.11.151)
|
26
|
+
aws-sdk-core (2.11.151)
|
27
27
|
aws-sigv4 (~> 1.0)
|
28
28
|
jmespath (~> 1.0)
|
29
|
-
aws-sdk-resources (2.11.
|
30
|
-
aws-sdk-core (= 2.11.
|
29
|
+
aws-sdk-resources (2.11.151)
|
30
|
+
aws-sdk-core (= 2.11.151)
|
31
31
|
aws-sigv4 (1.0.3)
|
32
32
|
azure_graph_rbac (0.17.0)
|
33
33
|
ms_rest_azure (~> 0.11.0)
|
@@ -16,6 +16,7 @@
|
|
16
16
|
#
|
17
17
|
|
18
18
|
require "tty-spinner"
|
19
|
+
require "tty-cursor"
|
19
20
|
require "chef_apply/status_reporter"
|
20
21
|
require "chef_apply/config"
|
21
22
|
require "chef_apply/log"
|
@@ -49,7 +50,10 @@ module ChefApply
|
|
49
50
|
# @option options [Hash] :style
|
50
51
|
# keys :top :middle and :bottom can contain Strings that are used to
|
51
52
|
# indent the spinners. Ignored if message is blank
|
52
|
-
multispinner = get_multispinner.new("[:spinner] #{header}",
|
53
|
+
multispinner = get_multispinner.new("[:spinner] #{header}",
|
54
|
+
output: @location,
|
55
|
+
hide_cursor: true,
|
56
|
+
style: indent_style)
|
53
57
|
jobs.each do |job|
|
54
58
|
multispinner.register(spinner_prefix(job.prefix), hide_cursor: true) do |spinner|
|
55
59
|
reporter = StatusReporter.new(spinner, prefix: job.prefix, key: :status)
|
@@ -57,6 +61,10 @@ module ChefApply
|
|
57
61
|
end
|
58
62
|
end
|
59
63
|
multispinner.auto_spin
|
64
|
+
ensure
|
65
|
+
# Spinners hide the cursor for better appearance, so we need to make sure
|
66
|
+
# we always bring it back
|
67
|
+
show_cursor
|
60
68
|
end
|
61
69
|
|
62
70
|
def render_job(initial_msg, job)
|
@@ -81,6 +89,10 @@ module ChefApply
|
|
81
89
|
def get_spinner
|
82
90
|
ChefApply::Config.dev.spinner ? TTY::Spinner : PlainTextElement
|
83
91
|
end
|
92
|
+
|
93
|
+
def show_cursor
|
94
|
+
TTY::Cursor.show()
|
95
|
+
end
|
84
96
|
end
|
85
97
|
end
|
86
98
|
end
|
data/lib/chef_apply/version.rb
CHANGED
@@ -54,6 +54,13 @@ RSpec.describe ChefApply::UI::Terminal do
|
|
54
54
|
expect(@job1ran).to eq true
|
55
55
|
expect(@job2ran).to eq true
|
56
56
|
end
|
57
|
+
it "always resets the cursor to visible" do
|
58
|
+
job1 = Terminal::Job.new("prefix", nil) do
|
59
|
+
raise "Cursor should be set visible"
|
60
|
+
end
|
61
|
+
expect(Terminal).to receive(:show_cursor)
|
62
|
+
Terminal.render_parallel_jobs("a message", [job1])
|
63
|
+
end
|
57
64
|
end
|
58
65
|
|
59
66
|
describe ChefApply::UI::Terminal::Job do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-apply
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Software, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-cli
|