tty-spinner 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -3
- data/lib/tty/spinner/version.rb +1 -1
- metadata +16 -102
- data/Rakefile +0 -8
- data/examples/auto_spin.rb +0 -8
- data/examples/basic.rb +0 -8
- data/examples/clear.rb +0 -9
- data/examples/color.rb +0 -12
- data/examples/error.rb +0 -9
- data/examples/formats.rb +0 -11
- data/examples/hide_cursor.rb +0 -12
- data/examples/multi/basic.rb +0 -13
- data/examples/multi/basic_top_level.rb +0 -13
- data/examples/multi/custom_style.rb +0 -26
- data/examples/multi/files.rb +0 -14
- data/examples/multi/jobs.rb +0 -10
- data/examples/multi/multi.rb +0 -17
- data/examples/multi/multi_top_level.rb +0 -18
- data/examples/multi/pause.rb +0 -26
- data/examples/multi/threaded.rb +0 -30
- data/examples/pause.rb +0 -19
- data/examples/run.rb +0 -18
- data/examples/success.rb +0 -9
- data/examples/threaded.rb +0 -11
- data/examples/update.rb +0 -11
- data/spec/spec_helper.rb +0 -51
- data/spec/unit/auto_spin_spec.rb +0 -27
- data/spec/unit/clear_spec.rb +0 -18
- data/spec/unit/error_spec.rb +0 -46
- data/spec/unit/events_spec.rb +0 -37
- data/spec/unit/formats_spec.rb +0 -9
- data/spec/unit/frames_spec.rb +0 -33
- data/spec/unit/hide_cursor_spec.rb +0 -53
- data/spec/unit/job_spec.rb +0 -14
- data/spec/unit/join_spec.rb +0 -12
- data/spec/unit/multi/auto_spin_spec.rb +0 -34
- data/spec/unit/multi/error_spec.rb +0 -109
- data/spec/unit/multi/line_inset_spec.rb +0 -59
- data/spec/unit/multi/on_spec.rb +0 -13
- data/spec/unit/multi/register_spec.rb +0 -47
- data/spec/unit/multi/spin_spec.rb +0 -103
- data/spec/unit/multi/stop_spec.rb +0 -97
- data/spec/unit/multi/success_spec.rb +0 -110
- data/spec/unit/new_spec.rb +0 -26
- data/spec/unit/pause_spec.rb +0 -25
- data/spec/unit/reset_spec.rb +0 -21
- data/spec/unit/run_spec.rb +0 -32
- data/spec/unit/spin_spec.rb +0 -119
- data/spec/unit/stop_spec.rb +0 -64
- data/spec/unit/success_spec.rb +0 -46
- data/spec/unit/update_spec.rb +0 -87
- data/tasks/console.rake +0 -11
- data/tasks/coverage.rake +0 -11
- data/tasks/spec.rake +0 -29
- data/tty-spinner.gemspec +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f67db708fa528fc2f9466f0f3ffad5c243f571e8cd75c91307ffb7e9f38fd37d
|
4
|
+
data.tar.gz: 8524d2c3973e18ef49c1371fc6bd43ce54ccbeaadbeb93268b5d3107eae625da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abff2b7c8bdb9b524fe667d4b5baef8506bcfd17a1e80031a10313e2dbfd10ba9e5cf69b72eae01a8de31970d4a1cf5a2de456fb779fe723a9b5b326f62e8146
|
7
|
+
data.tar.gz: cfc1167501830593b9b65e4c5ef49852ebb1d5aaafcb4656d048dedd4d9a911e380b3e1ee5562c098819f4e36693dcfee940c74443291df3affc4cd9cc37d711
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## [v0.9.3] - 2020-01-28
|
4
|
+
|
5
|
+
### Changed
|
6
|
+
* Change gemspec to add metadata, remove test artefacts and load version directly
|
7
|
+
|
3
8
|
## [v0.9.2] - 2019-12-08
|
4
9
|
|
5
10
|
### Fixed
|
@@ -52,8 +57,8 @@
|
|
52
57
|
## [v0.6.0] - 2017-09-07
|
53
58
|
|
54
59
|
### Changed
|
55
|
-
* Change TTY::Spinner::Multi to render
|
56
|
-
position at point of
|
60
|
+
* Change TTY::Spinner::Multi to render registered spinners at row
|
61
|
+
position at point of rendering and not registration
|
57
62
|
|
58
63
|
### Fixed
|
59
64
|
* Fix handling of multi spinner events
|
@@ -113,12 +118,13 @@
|
|
113
118
|
|
114
119
|
### Changed
|
115
120
|
* Change message formatting, use :spinner token to customize message
|
116
|
-
* Change format for
|
121
|
+
* Change format for defining spinner formats and intervals
|
117
122
|
|
118
123
|
## [v0.1.0] - 2014-11-15
|
119
124
|
|
120
125
|
* Initial implementation and release
|
121
126
|
|
127
|
+
[v0.9.3]: https://github.com/piotrmurach/tty-spinner/compare/v0.9.2...v0.9.3
|
122
128
|
[v0.9.2]: https://github.com/piotrmurach/tty-spinner/compare/v0.9.1...v0.9.2
|
123
129
|
[v0.9.1]: https://github.com/piotrmurach/tty-spinner/compare/v0.9.0...v0.9.1
|
124
130
|
[v0.9.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.8.0...v0.9.0
|
data/lib/tty/spinner/version.rb
CHANGED
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Murach
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-cursor
|
@@ -24,119 +24,33 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.7'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: bundler
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 1.5.0
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 1.5.0
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rspec
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '3.1'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '3.1'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rake
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
27
|
description: A terminal spinner for tasks that have non-deterministic time frame.
|
70
28
|
email:
|
71
|
-
-
|
29
|
+
- piotr@piotrmurach.com
|
72
30
|
executables: []
|
73
31
|
extensions: []
|
74
|
-
extra_rdoc_files:
|
32
|
+
extra_rdoc_files:
|
33
|
+
- README.md
|
34
|
+
- CHANGELOG.md
|
75
35
|
files:
|
76
36
|
- CHANGELOG.md
|
77
37
|
- LICENSE.txt
|
78
38
|
- README.md
|
79
|
-
- Rakefile
|
80
|
-
- examples/auto_spin.rb
|
81
|
-
- examples/basic.rb
|
82
|
-
- examples/clear.rb
|
83
|
-
- examples/color.rb
|
84
|
-
- examples/error.rb
|
85
|
-
- examples/formats.rb
|
86
|
-
- examples/hide_cursor.rb
|
87
|
-
- examples/multi/basic.rb
|
88
|
-
- examples/multi/basic_top_level.rb
|
89
|
-
- examples/multi/custom_style.rb
|
90
|
-
- examples/multi/files.rb
|
91
|
-
- examples/multi/jobs.rb
|
92
|
-
- examples/multi/multi.rb
|
93
|
-
- examples/multi/multi_top_level.rb
|
94
|
-
- examples/multi/pause.rb
|
95
|
-
- examples/multi/threaded.rb
|
96
|
-
- examples/pause.rb
|
97
|
-
- examples/run.rb
|
98
|
-
- examples/success.rb
|
99
|
-
- examples/threaded.rb
|
100
|
-
- examples/update.rb
|
101
39
|
- lib/tty-spinner.rb
|
102
40
|
- lib/tty/spinner.rb
|
103
41
|
- lib/tty/spinner/formats.rb
|
104
42
|
- lib/tty/spinner/multi.rb
|
105
43
|
- lib/tty/spinner/version.rb
|
106
|
-
|
107
|
-
- spec/unit/auto_spin_spec.rb
|
108
|
-
- spec/unit/clear_spec.rb
|
109
|
-
- spec/unit/error_spec.rb
|
110
|
-
- spec/unit/events_spec.rb
|
111
|
-
- spec/unit/formats_spec.rb
|
112
|
-
- spec/unit/frames_spec.rb
|
113
|
-
- spec/unit/hide_cursor_spec.rb
|
114
|
-
- spec/unit/job_spec.rb
|
115
|
-
- spec/unit/join_spec.rb
|
116
|
-
- spec/unit/multi/auto_spin_spec.rb
|
117
|
-
- spec/unit/multi/error_spec.rb
|
118
|
-
- spec/unit/multi/line_inset_spec.rb
|
119
|
-
- spec/unit/multi/on_spec.rb
|
120
|
-
- spec/unit/multi/register_spec.rb
|
121
|
-
- spec/unit/multi/spin_spec.rb
|
122
|
-
- spec/unit/multi/stop_spec.rb
|
123
|
-
- spec/unit/multi/success_spec.rb
|
124
|
-
- spec/unit/new_spec.rb
|
125
|
-
- spec/unit/pause_spec.rb
|
126
|
-
- spec/unit/reset_spec.rb
|
127
|
-
- spec/unit/run_spec.rb
|
128
|
-
- spec/unit/spin_spec.rb
|
129
|
-
- spec/unit/stop_spec.rb
|
130
|
-
- spec/unit/success_spec.rb
|
131
|
-
- spec/unit/update_spec.rb
|
132
|
-
- tasks/console.rake
|
133
|
-
- tasks/coverage.rake
|
134
|
-
- tasks/spec.rake
|
135
|
-
- tty-spinner.gemspec
|
136
|
-
homepage: https://piotrmurach.github.io/tty
|
44
|
+
homepage: https://ttytoolkit.org
|
137
45
|
licenses:
|
138
46
|
- MIT
|
139
|
-
metadata:
|
47
|
+
metadata:
|
48
|
+
allowed_push_host: https://rubygems.org
|
49
|
+
bug_tracker_uri: https://github.com/piotrmurach/tty-spinner/issues
|
50
|
+
changelog_uri: https://github.com/piotrmurach/tty-spinner/blob/master/CHANGELOG.md
|
51
|
+
documentation_uri: https://www.rubydoc.info/gems/tty-spinner
|
52
|
+
homepage_uri: https://ttytoolkit.org
|
53
|
+
source_code_uri: https://github.com/piotrmurach/tty-spinner
|
140
54
|
post_install_message:
|
141
55
|
rdoc_options: []
|
142
56
|
require_paths:
|
@@ -152,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
66
|
- !ruby/object:Gem::Version
|
153
67
|
version: '0'
|
154
68
|
requirements: []
|
155
|
-
rubygems_version: 3.
|
69
|
+
rubygems_version: 3.1.2
|
156
70
|
signing_key:
|
157
71
|
specification_version: 4
|
158
72
|
summary: A terminal spinner for tasks that have non-deterministic time frame.
|
data/Rakefile
DELETED
data/examples/auto_spin.rb
DELETED
data/examples/basic.rb
DELETED
data/examples/clear.rb
DELETED
data/examples/color.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'pastel'
|
2
|
-
require_relative '../lib/tty-spinner'
|
3
|
-
|
4
|
-
pastel = Pastel.new
|
5
|
-
|
6
|
-
format = "[#{pastel.yellow(':spinner')}] " + pastel.yellow("Task name")
|
7
|
-
spinner = TTY::Spinner.new(format, success_mark: pastel.green('+'))
|
8
|
-
20.times do
|
9
|
-
spinner.spin
|
10
|
-
sleep(0.1)
|
11
|
-
end
|
12
|
-
spinner.success(pastel.green("(successful)"))
|
data/examples/error.rb
DELETED
data/examples/formats.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
require_relative '../lib/tty-spinner'
|
2
|
-
|
3
|
-
TTY::Formats::FORMATS.keys.each do |token|
|
4
|
-
options = {format: token, hide_cursor: true}
|
5
|
-
spinner = TTY::Spinner.new("#{token}: :spinner", options)
|
6
|
-
20.times do
|
7
|
-
spinner.spin
|
8
|
-
sleep(0.1)
|
9
|
-
end
|
10
|
-
spinner.stop
|
11
|
-
end
|
data/examples/hide_cursor.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'pastel'
|
2
|
-
require_relative '../lib/tty-spinner'
|
3
|
-
|
4
|
-
pastel = Pastel.new
|
5
|
-
|
6
|
-
format = "[#{pastel.yellow(':spinner')}] " + pastel.yellow("Task name")
|
7
|
-
spinner = TTY::Spinner.new(format, success_mark: pastel.green('+'), hide_cursor: true)
|
8
|
-
10.times do
|
9
|
-
spinner.spin
|
10
|
-
sleep(0.1)
|
11
|
-
end
|
12
|
-
spinner.success(pastel.green("(successful)"))
|
data/examples/multi/basic.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require_relative '../../lib/tty-spinner'
|
2
|
-
|
3
|
-
spinners = TTY::Spinner::Multi.new
|
4
|
-
|
5
|
-
sp1 = spinners.register "[:spinner] one"
|
6
|
-
sp2 = spinners.register "[:spinner] two"
|
7
|
-
sp3 = spinners.register "[:spinner] three"
|
8
|
-
|
9
|
-
th1 = Thread.new { 20.times { sleep(0.2); sp1.spin }}
|
10
|
-
th2 = Thread.new { 30.times { sleep(0.1); sp2.spin }}
|
11
|
-
th3 = Thread.new { 10.times { sleep(0.3); sp3.spin }}
|
12
|
-
|
13
|
-
[th1, th2, th3].each(&:join)
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require_relative '../../lib/tty-spinner'
|
2
|
-
|
3
|
-
spinners = TTY::Spinner::Multi.new "[:spinner] main", format: :pulse
|
4
|
-
|
5
|
-
sp1 = spinners.register "[:spinner] one", format: :classic
|
6
|
-
sp2 = spinners.register "[:spinner] two", format: :classic
|
7
|
-
sp3 = spinners.register "[:spinner] three", format: :classic
|
8
|
-
|
9
|
-
th1 = Thread.new { 20.times { sleep(0.2); sp1.spin }}
|
10
|
-
th2 = Thread.new { 30.times { sleep(0.1); sp2.spin }}
|
11
|
-
th3 = Thread.new { 10.times { sleep(0.3); sp3.spin }}
|
12
|
-
|
13
|
-
[th1, th2, th3].each(&:join)
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require_relative '../../lib/tty-spinner'
|
2
|
-
|
3
|
-
opts = {
|
4
|
-
style: {
|
5
|
-
top: ". ",
|
6
|
-
middle: "|-> ",
|
7
|
-
bottom: "|__ ",
|
8
|
-
},
|
9
|
-
format: :bouncing_ball
|
10
|
-
}
|
11
|
-
spinners = TTY::Spinner::Multi.new("[:spinner] Top level spinner", opts)
|
12
|
-
|
13
|
-
sp1 = spinners.register "[:spinner] one"
|
14
|
-
sp2 = spinners.register "[:spinner] two"
|
15
|
-
sp3 = spinners.register "[:spinner] three"
|
16
|
-
|
17
|
-
sp1.auto_spin
|
18
|
-
sp2.auto_spin
|
19
|
-
sp3.auto_spin
|
20
|
-
|
21
|
-
sleep(2)
|
22
|
-
sp1.success
|
23
|
-
sleep 1
|
24
|
-
sp2.success
|
25
|
-
sleep 1
|
26
|
-
sp3.error
|
data/examples/multi/files.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
require 'pastel'
|
2
|
-
require_relative '../../lib/tty-spinner'
|
3
|
-
|
4
|
-
pastel = Pastel.new
|
5
|
-
spinners = TTY::Spinner::Multi.new("[:spinner] Downloading files...")
|
6
|
-
|
7
|
-
['file1', 'file2', 'file3'].each do |file|
|
8
|
-
spinners.register("[:spinner] #{file}") do |sp|
|
9
|
-
sleep(rand * 5)
|
10
|
-
sp.success(pastel.green("success"))
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
spinners.auto_spin
|
data/examples/multi/jobs.rb
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
require_relative '../../lib/tty-spinner'
|
2
|
-
|
3
|
-
spinners = TTY::Spinner::Multi.new("[:spinner] top")
|
4
|
-
|
5
|
-
spinners.register("[:spinner] one") { |sp| sleep(2); sp.success('yes 2') }
|
6
|
-
spinners.register("[:spinner] two") { |sp| sleep(3); sp.error('no 2') }
|
7
|
-
spinners.register("[:spinner] three") { |sp| sleep(1); sp.success('yes 3') }
|
8
|
-
|
9
|
-
spinners.auto_spin
|
10
|
-
|
data/examples/multi/multi.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
require_relative '../../lib/tty-spinner'
|
2
|
-
|
3
|
-
spinners = TTY::Spinner::Multi.new
|
4
|
-
|
5
|
-
sp1 = spinners.register "[:spinner] one"
|
6
|
-
sp2 = spinners.register "[:spinner] two"
|
7
|
-
sp3 = spinners.register "[:spinner] three"
|
8
|
-
|
9
|
-
sp1.auto_spin
|
10
|
-
sp2.auto_spin
|
11
|
-
sp3.auto_spin
|
12
|
-
|
13
|
-
sleep(2)
|
14
|
-
|
15
|
-
sp1.stop
|
16
|
-
sp2.stop
|
17
|
-
sp3.stop
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require_relative '../../lib/tty-spinner'
|
2
|
-
|
3
|
-
spinners = TTY::Spinner::Multi.new("[:spinner] Top level spinner")
|
4
|
-
|
5
|
-
sp1 = spinners.register "[:spinner] one"
|
6
|
-
sp2 = spinners.register "[:spinner] two"
|
7
|
-
sp3 = spinners.register "[:spinner] three"
|
8
|
-
|
9
|
-
sp1.auto_spin
|
10
|
-
sp2.auto_spin
|
11
|
-
sp3.auto_spin
|
12
|
-
|
13
|
-
sleep(2)
|
14
|
-
sp1.success
|
15
|
-
sleep 1
|
16
|
-
sp2.success
|
17
|
-
sleep 1
|
18
|
-
sp3.error
|
data/examples/multi/pause.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
require_relative '../../lib/tty-spinner'
|
2
|
-
|
3
|
-
spinners = TTY::Spinner::Multi.new("[:spinner]")
|
4
|
-
|
5
|
-
sp1 = spinners.register("[:spinner] one")
|
6
|
-
sp2 = spinners.register("[:spinner] two")
|
7
|
-
sp3 = spinners.register("[:spinner] three")
|
8
|
-
|
9
|
-
sp1.auto_spin
|
10
|
-
sp2.auto_spin
|
11
|
-
sp3.auto_spin
|
12
|
-
|
13
|
-
sleep(1)
|
14
|
-
|
15
|
-
spinners.pause
|
16
|
-
|
17
|
-
sleep(1)
|
18
|
-
|
19
|
-
spinners.resume
|
20
|
-
|
21
|
-
sleep(1)
|
22
|
-
|
23
|
-
sp1.stop
|
24
|
-
sp2.stop
|
25
|
-
sp3.stop
|
26
|
-
spinners.stop
|