tty-progressbar 0.18.2 → 0.18.3
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 +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +8 -11
- data/lib/tty/progressbar/version.rb +1 -1
- data/lib/tty/progressbar.rb +6 -1
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9d001da1f38dc2f722255b66f498763ddc3a3a55f04598866e25d33701d5ced
|
4
|
+
data.tar.gz: 49e83e50c0f6265b3f76f1536f825f5dbe1abb89353c2e3dc7124ff24b26af27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f035e2789509e8e56fd1480136b6c8d4c4c07c7497ca9d7409e85ff619957badbf281a76ec2b194c4787a1e0502c596cae6ae68912ba01e62cda6cd2ad7ac52f
|
7
|
+
data.tar.gz: 9cd2b4fd1cae46809e764329f55722ddb23d801977ec351727051671510402ea6774969f8b4b984369629f894e40d8b77459cb8133ff53efbbc7ebacb27e552e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## [v0.18.3] - 2024-11-10
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
* Fix setting the current progress for an indeterminate bar by Alex Watt
|
7
|
+
(@alexcwatt)
|
8
|
+
|
3
9
|
## [v0.18.2] - 2021-03-08
|
4
10
|
|
5
11
|
### Fixed
|
@@ -242,6 +248,7 @@
|
|
242
248
|
|
243
249
|
* Initial implementation and release
|
244
250
|
|
251
|
+
[v0.18.3]: https://github.com/piotrmurach/tty-progressbar/compare/v0.18.2...v0.18.3
|
245
252
|
[v0.18.2]: https://github.com/piotrmurach/tty-progressbar/compare/v0.18.1...v0.18.2
|
246
253
|
[v0.18.1]: https://github.com/piotrmurach/tty-progressbar/compare/v0.18.0...v0.18.1
|
247
254
|
[v0.18.0]: https://github.com/piotrmurach/tty-progressbar/compare/v0.17.0...v0.18.0
|
data/README.md
CHANGED
@@ -2,22 +2,19 @@
|
|
2
2
|
<a href="https://ttytoolkit.org"><img width="130" src="https://github.com/piotrmurach/tty/raw/master/images/tty.png" alt="TTY Toolkit logo"/></a>
|
3
3
|
</div>
|
4
4
|
|
5
|
-
# TTY::ProgressBar
|
5
|
+
# TTY::ProgressBar
|
6
6
|
|
7
7
|
[][gem]
|
8
|
-
[][gh_actions_ci]
|
9
9
|
[][appveyor]
|
10
10
|
[][codeclimate]
|
11
11
|
[][coverage]
|
12
|
-
[][inchpages]
|
13
12
|
|
14
|
-
[
|
15
|
-
[
|
16
|
-
[gh_actions_ci]: https://github.com/piotrmurach/tty-progressbar/actions?query=workflow%3ACI
|
13
|
+
[gem]: https://badge.fury.io/rb/tty-progressbar
|
14
|
+
[gh_actions_ci]: https://github.com/piotrmurach/tty-progressbar/actions/workflows/ci.yml
|
17
15
|
[appveyor]: https://ci.appveyor.com/project/piotrmurach/tty-progressbar
|
18
16
|
[codeclimate]: https://codeclimate.com/github/piotrmurach/tty-progressbar/maintainability
|
19
17
|
[coverage]: https://coveralls.io/github/piotrmurach/tty-progressbar
|
20
|
-
[inchpages]: http://inch-ci.org/github/piotrmurach/tty-progressbar
|
21
18
|
|
22
19
|
> A flexible and extensible progress bar for terminal applications.
|
23
20
|
|
@@ -111,7 +108,7 @@ $ gem install tty-progressbar
|
|
111
108
|
* [6.12 on](#612-on)
|
112
109
|
* [6.13 :style](#613-style)
|
113
110
|
* [7. Examples](#7-examples)
|
114
|
-
* [7.1
|
111
|
+
* [7.1 Colors](#71-colors)
|
115
112
|
* [7.2 Speed](#72-speed)
|
116
113
|
|
117
114
|
## 1. Usage
|
@@ -222,7 +219,7 @@ By default, progress bar is advanced by `1` but you can change it by passing sec
|
|
222
219
|
bar.iterate(30.times, 5)
|
223
220
|
```
|
224
221
|
|
225
|
-
One particularly useful application of `iterate` are Ruby infamous [lazy enumerators](
|
222
|
+
One particularly useful application of `iterate` are Ruby infamous [lazy enumerators](https://ruby-doc.org/core-2.5.0/Enumerator/Lazy.html), or slowly advancing enumerations, representing complex processes.
|
226
223
|
|
227
224
|
For example, an `Enumerator` that downloads content from a remote server chunk at a time:
|
228
225
|
|
@@ -453,7 +450,7 @@ The progress bar's configuration can also be changed at runtime with `configure`
|
|
453
450
|
```ruby
|
454
451
|
bar.configure do |config|
|
455
452
|
config.total = 100 # takes precedence over the original value
|
456
|
-
config.
|
453
|
+
config.frequency = 20
|
457
454
|
end
|
458
455
|
```
|
459
456
|
|
@@ -1058,7 +1055,7 @@ This will result in output similar to:
|
|
1058
1055
|
4. Push to the branch (`git push origin my-new-feature`)
|
1059
1056
|
5. Create a new Pull Request
|
1060
1057
|
|
1061
|
-
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](
|
1058
|
+
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](https://contributor-covenant.org) code of conduct.
|
1062
1059
|
|
1063
1060
|
## Code of Conduct
|
1064
1061
|
|
data/lib/tty/progressbar.rb
CHANGED
@@ -290,7 +290,12 @@ module TTY
|
|
290
290
|
#
|
291
291
|
# @api public
|
292
292
|
def current=(value)
|
293
|
-
|
293
|
+
unless value.is_a?(Numeric)
|
294
|
+
raise ArgumentError, "Expected a numeric value, " \
|
295
|
+
"got #{value.inspect} instead."
|
296
|
+
end
|
297
|
+
|
298
|
+
value = [0, [value, total].compact.min].max
|
294
299
|
advance(value - @current)
|
295
300
|
end
|
296
301
|
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Murach
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: strings-ansi
|
@@ -163,9 +163,11 @@ metadata:
|
|
163
163
|
bug_tracker_uri: https://github.com/piotrmurach/tty-progressbar/issues
|
164
164
|
changelog_uri: https://github.com/piotrmurach/tty-progressbar/blob/master/CHANGELOG.md
|
165
165
|
documentation_uri: https://www.rubydoc.info/gems/tty-progressbar
|
166
|
+
funding_uri: https://github.com/sponsors/piotrmurach
|
166
167
|
homepage_uri: https://ttytoolkit.org
|
168
|
+
rubygems_mfa_required: 'true'
|
167
169
|
source_code_uri: https://github.com/piotrmurach/tty-progressbar
|
168
|
-
post_install_message:
|
170
|
+
post_install_message:
|
169
171
|
rdoc_options: []
|
170
172
|
require_paths:
|
171
173
|
- lib
|
@@ -180,8 +182,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
182
|
- !ruby/object:Gem::Version
|
181
183
|
version: '0'
|
182
184
|
requirements: []
|
183
|
-
rubygems_version: 3.
|
184
|
-
signing_key:
|
185
|
+
rubygems_version: 3.4.10
|
186
|
+
signing_key:
|
185
187
|
specification_version: 4
|
186
188
|
summary: A flexible and extensible progress bar for terminal applications.
|
187
189
|
test_files: []
|