tty-progressbar 0.18.0 → 0.18.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ce16ff1076a290596a04263c1fb09cd3246d4ea02e70a050405ee64c1b402e7
|
4
|
+
data.tar.gz: 7cd54ae7c051e037bad54b6992779bbd3afaeab89a112f9e9d1dd5f1bbeb0a11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04c89a52f0c7467b420419edb5841e52f5ce667b666cb8637aebf6295448598d6fbdd73874823d3b73df7fb38d633a7b94931c34356295dd812bb86cc55aa882
|
7
|
+
data.tar.gz: c8f65a47aa2258da3baceb42a146b528779e4b659031c2dd5dab33aba55d42673abcb885197112608a01c6147c4476d5bbdeea9db577a69478bf2f5aaa58cc91
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## [v0.18.1] - 2021-01-25
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
* Fix :eta and :eta_time format tokens display when progress isn't started
|
7
|
+
|
3
8
|
## [v0.18.0] - 2021-01-20
|
4
9
|
|
5
10
|
### Added
|
@@ -232,6 +237,7 @@
|
|
232
237
|
|
233
238
|
* Initial implementation and release
|
234
239
|
|
240
|
+
[v0.18.1]: https://github.com/piotrmurach/tty-progressbar/compare/v0.18.0...v0.18.1
|
235
241
|
[v0.18.0]: https://github.com/piotrmurach/tty-progressbar/compare/v0.17.0...v0.18.0
|
236
242
|
[v0.17.0]: https://github.com/piotrmurach/tty-progressbar/compare/v0.16.0...v0.17.0
|
237
243
|
[v0.16.0]: https://github.com/piotrmurach/tty-progressbar/compare/v0.15.1...v0.16.0
|
@@ -18,13 +18,15 @@ module TTY
|
|
18
18
|
#
|
19
19
|
# @api public
|
20
20
|
def call(value)
|
21
|
-
if @progress.indeterminate?
|
21
|
+
if @progress.indeterminate? ||
|
22
|
+
(@progress.elapsed_time.zero? && @progress.ratio.zero?)
|
22
23
|
return value.gsub(matcher, "--s")
|
23
24
|
end
|
24
25
|
|
25
26
|
elapsed = @progress.elapsed_time
|
26
|
-
estimated = (elapsed / @progress.ratio).to_f
|
27
|
-
estimated
|
27
|
+
estimated = @progress.ratio.zero? ? 0.0 : (elapsed / @progress.ratio).to_f
|
28
|
+
estimated -= elapsed
|
29
|
+
estimated = 0.0 if estimated < 0
|
28
30
|
value.gsub(matcher, Converter.to_time(estimated))
|
29
31
|
end
|
30
32
|
end # EstimatedFormatter
|
@@ -15,13 +15,15 @@ module TTY
|
|
15
15
|
#
|
16
16
|
# @api public
|
17
17
|
def call(value)
|
18
|
-
if @progress.indeterminate?
|
18
|
+
if @progress.indeterminate? ||
|
19
|
+
(@progress.elapsed_time.zero? && @progress.ratio.zero?)
|
19
20
|
return value.gsub(matcher, "--:--:--")
|
20
21
|
end
|
21
22
|
|
22
23
|
elapsed = @progress.elapsed_time
|
23
|
-
estimated = (elapsed / @progress.ratio).to_f
|
24
|
-
estimated
|
24
|
+
estimated = @progress.ratio.zero? ? 0.0 : (elapsed / @progress.ratio).to_f
|
25
|
+
estimated -= elapsed
|
26
|
+
estimated = 0.0 if estimated < 0
|
25
27
|
|
26
28
|
time_format = if estimated >= 86_400 # longer than a day
|
27
29
|
"%Y-%m-%d %H:%M:%S"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tty-progressbar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.18.
|
4
|
+
version: 0.18.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Murach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: strings-ansi
|