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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c407573060088eee9aae20ccbeaea7b7ab2dc6f138f60d4cb70a8f1712deb9f
4
- data.tar.gz: 04fdb8167510803571249b1106d8a40c15a116940f39c8c8b01e6ac235f1bf08
3
+ metadata.gz: 96bd3cd66e3292a4a49e7f51dc0ddf56d06c10427a0de936bd0a963cbe66a68b
4
+ data.tar.gz: 5c4516265bcdce18a77c920b1311c702e16f99efc367e79e44d50ca816103027
5
5
  SHA512:
6
- metadata.gz: 0a24fb01f7a56b86e7dc0c2841377313cae84554810034ead9c2648f05c9f3d86f874198afa77d40904334f1504236b8b8aab20d9f2d99ec3f48ea154d8e1ce2
7
- data.tar.gz: 0bcefdfe8d58288610029c21fb1ccc04cd862ec540ed0c74cc7511be13b9c4e405586fc5165060cb5cf97287eb7ec3048432c05ea5db1bab31b1e5412ff757e6
6
+ metadata.gz: fcdeb174e4e46b9479c896086ee16372549e902dd16ca841ce7eb9c388034e954bf676f4af121e33fc2665b8e4c351856d34776d89d8be112593d0f7c9190b15
7
+ data.tar.gz: e990455d5be05a01f933d7bb6572cb28e00e4c65cccdf8af622b0f7c6edd2356c007b7c49f7a0d7bc4265ff9cca9f0599fb69449415eef03edf73559a4d80dc0
@@ -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
@@ -372,7 +372,7 @@ module TTY
372
372
  # @api private
373
373
  def redraw_indent
374
374
  if @hide_cursor && !spinning?
375
- write(ECMA_CSI + DEC_TCEM + DEC_RST)
375
+ write(TTY::Cursor.hide)
376
376
  end
377
377
 
378
378
  write("", false)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module TTY
4
4
  class Spinner
5
- VERSION = '0.9.1'
5
+ VERSION = "0.9.2"
6
6
  end # Spinner
7
7
  end # TTY
@@ -46,26 +46,55 @@ RSpec.describe TTY::Spinner, '#spin' do
46
46
  ].join)
47
47
  end
48
48
 
49
- it "can spin and redraw indent" do
50
- multi_spinner = double("MultiSpinner")
51
- allow(multi_spinner).to receive(:synchronize).and_yield
52
- allow(multi_spinner).to receive(:next_row).and_return(1)
53
- allow(multi_spinner).to receive(:rows).and_return(1)
54
- allow(multi_spinner).to receive(:line_inset).and_return("--- ")
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
- spinner = TTY::Spinner.new(output: output)
57
- spinner.attach_to(multi_spinner)
58
- spinner.spin
59
- spinner.redraw_indent
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
- output.rewind
62
- expect(output.read).to eq([
63
- "\e[1G--- |\n",
64
- save,
65
- "\e[1A",
66
- "--- ",
67
- restore,
68
- ].join)
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.1
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-05-29 00:00:00.000000000 Z
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.3
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.