tty-spinner 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/tty/spinner.rb +1 -1
- data/lib/tty/spinner/version.rb +1 -1
- data/spec/unit/spin_spec.rb +47 -18
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96bd3cd66e3292a4a49e7f51dc0ddf56d06c10427a0de936bd0a963cbe66a68b
|
4
|
+
data.tar.gz: 5c4516265bcdce18a77c920b1311c702e16f99efc367e79e44d50ca816103027
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcdeb174e4e46b9479c896086ee16372549e902dd16ca841ce7eb9c388034e954bf676f4af121e33fc2665b8e4c351856d34776d89d8be112593d0f7c9190b15
|
7
|
+
data.tar.gz: e990455d5be05a01f933d7bb6572cb28e00e4c65cccdf8af622b0f7c6edd2356c007b7c49f7a0d7bc4265ff9cca9f0599fb69449415eef03edf73559a4d80dc0
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## [v0.9.2] - 2019-12-08
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
* Fix multi spinner cursor hiding by @benklop
|
7
|
+
|
3
8
|
## [v0.9.1] - 2019-05-29
|
4
9
|
|
5
10
|
### Changed
|
@@ -114,6 +119,7 @@
|
|
114
119
|
|
115
120
|
* Initial implementation and release
|
116
121
|
|
122
|
+
[v0.9.2]: https://github.com/piotrmurach/tty-spinner/compare/v0.9.1...v0.9.2
|
117
123
|
[v0.9.1]: https://github.com/piotrmurach/tty-spinner/compare/v0.9.0...v0.9.1
|
118
124
|
[v0.9.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.8.0...v0.9.0
|
119
125
|
[v0.8.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.7.0...v0.8.0
|
data/lib/tty/spinner.rb
CHANGED
data/lib/tty/spinner/version.rb
CHANGED
data/spec/unit/spin_spec.rb
CHANGED
@@ -46,26 +46,55 @@ RSpec.describe TTY::Spinner, '#spin' do
|
|
46
46
|
].join)
|
47
47
|
end
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
49
|
+
context "with the cursor" do
|
50
|
+
before do
|
51
|
+
multi_spinner = double("MultiSpinner")
|
52
|
+
allow(multi_spinner).to receive(:synchronize).and_yield
|
53
|
+
allow(multi_spinner).to receive(:next_row).and_return(1)
|
54
|
+
allow(multi_spinner).to receive(:rows).and_return(1)
|
55
|
+
allow(multi_spinner).to receive(:line_inset).and_return("--- ")
|
55
56
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
57
|
+
spinner = TTY::Spinner.new(output: output, hide_cursor: hide_cursor)
|
58
|
+
spinner.attach_to(multi_spinner)
|
59
|
+
spinner.spin
|
60
|
+
spinner.redraw_indent
|
60
61
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
62
|
+
output.rewind
|
63
|
+
end
|
64
|
+
|
65
|
+
context "on" do
|
66
|
+
let(:hide_cursor) { false }
|
67
|
+
|
68
|
+
it "can spin and redraw indent" do
|
69
|
+
expect(output.read).to eq([
|
70
|
+
"\e[1G--- |\n",
|
71
|
+
save,
|
72
|
+
"\e[1A",
|
73
|
+
"--- ",
|
74
|
+
restore
|
75
|
+
].join)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
context "off" do
|
80
|
+
let(:hide_cursor) { true }
|
81
|
+
|
82
|
+
it "can spin and redraw indent" do
|
83
|
+
expect(output.read).to eq([
|
84
|
+
"--- ",
|
85
|
+
"\e[?25l\n",
|
86
|
+
save,
|
87
|
+
"\e[1A",
|
88
|
+
"\e[1G",
|
89
|
+
"--- |",
|
90
|
+
restore,
|
91
|
+
save,
|
92
|
+
"\e[1A",
|
93
|
+
"--- ",
|
94
|
+
restore
|
95
|
+
].join)
|
96
|
+
end
|
97
|
+
end
|
69
98
|
end
|
70
99
|
|
71
100
|
it "spins with many threads" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tty-spinner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Murach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-cursor
|
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
152
|
- !ruby/object:Gem::Version
|
153
153
|
version: '0'
|
154
154
|
requirements: []
|
155
|
-
rubygems_version: 3.0.
|
155
|
+
rubygems_version: 3.0.6
|
156
156
|
signing_key:
|
157
157
|
specification_version: 4
|
158
158
|
summary: A terminal spinner for tasks that have non-deterministic time frame.
|