progressbar 1.10.1 → 1.11.0

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: 67fc001f8d824714d07ba5104ff443279d56278237ef0dd3a38a4c37c14ea439
4
- data.tar.gz: ababf036ac5d1dfab51a1bf81bf5ad6c20392c7076cb50bdc7243d4e12f6e47d
3
+ metadata.gz: d5bc49bb14e8635e80a71dd8aae8e6e80d42b1eedda7342c4b3ff975487bd119
4
+ data.tar.gz: af44f894c1ab7d25ae2ce4a4f150bc565e68669aa8f24220cb91e59eb6cb98ae
5
5
  SHA512:
6
- metadata.gz: 42b2df9371280cb1d2b49514f90902ee3da921fe7ec9cc50f5fc3e41f6fd4691cc0f64353c3b4f96cc8c74593b88a7060090a5f01eb59567685a3a32481b885a
7
- data.tar.gz: 2af0570d34f69df8d82314840fe90da1348328648da99d80e0056fe9ae55a18821980b79c2cd3d8e1d47fee1a986d25430f2a1c3d8592221d8e8714ccf298498
6
+ metadata.gz: 231ae03f6609373a4dbe57ab1fe4866b03afadc376b6766e00c60c3fde434acc39a69df57f68496d4927285d69437f5573f1a8be608fd2e997e4f9eaa9ee1890
7
+ data.tar.gz: 4efaeb90bd8c1d420a39fc73df3c17d1d3745ccf3f0987528eb9f6750b8fe0b06633ae19a3dd9ec634a55883a1f6271710935e7d10744c409fc0c4eb64f414ed
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2016 The Kompanee, Ltd
1
+ Copyright (c) 2010-2019 The Kompanee, Ltd
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,38 +1,131 @@
1
1
  Ruby/ProgressBar
2
- ================================
3
- [![Gem Version](https://img.shields.io/gem/v/ruby-progressbar.svg)](https://rubygems.org/gems/ruby-progressbar) ![Rubygems Rank Overall](https://img.shields.io/gem/rt/ruby-progressbar.svg) ![Rubygems Rank Daily](https://img.shields.io/gem/rd/ruby-progressbar.svg) ![Rubygems Downloads](https://img.shields.io/gem/dv/ruby-progressbar/stable.svg) [![Build Status](https://img.shields.io/travis/jfelchner/ruby-progressbar/master.svg)](http://travis-ci.org/jfelchner/ruby-progressbar) [![Code Climate](https://codeclimate.com/github/jfelchner/ruby-progressbar.svg)](https://codeclimate.com/github/jfelchner/ruby-progressbar) [![Code Climate](https://codeclimate.com/github/jfelchner/ruby-progressbar/coverage.svg)](https://codeclimate.com/github/jfelchner/ruby-progressbar)
2
+ ================================================================================
3
+
4
+ <div align="center">
5
+ <a href="https://rubygems.org/gems/ruby-progressbar" alt="RubyGems Version">
6
+ <img src="https://img.shields.io/gem/v/ruby-progressbar.svg?style=flat-square&label=current-version" alt="RubyGems Version" />
7
+ </a>
8
+
9
+ <a href="https://rubygems.org/gems/ruby-progressbar" alt="RubyGems Rank Overall">
10
+ <img src="https://img.shields.io/gem/rt/ruby-progressbar.svg?style=flat-square&label=total-rank" alt="RubyGems Rank Overall" />
11
+ </a>
12
+
13
+ <a href="https://rubygems.org/gems/ruby-progressbar" alt="RubyGems Rank Daily">
14
+ <img src="https://img.shields.io/gem/rd/ruby-progressbar.svg?style=flat-square&label=daily-rank" alt="RubyGems Rank Daily" />
15
+ </a>
16
+
17
+ <a href="https://rubygems.org/gems/ruby-progressbar" alt="RubyGems Downloads">
18
+ <img src="https://img.shields.io/gem/dt/ruby-progressbar.svg?style=flat-square&label=total-downloads" alt="RubyGems Downloads" />
19
+ </a>
20
+
21
+ <a href="https://github.com/jfelchner/ruby-progressbar/actions?query=workflow%3ABuild" alt="Build Status">
22
+ <img src="https://img.shields.io/github/workflow/status/jfelchner/ruby-progressbar/Build?label=CI&style=flat-square&logo=github" alt="Build Status" />
23
+ </a>
24
+
25
+ <a href="#" alt="Maintainability">
26
+ <img src="https://img.shields.io/codeclimate/maintainability/jfelchner/ruby-progressbar?style=flat-square&label=grade" alt="Maintainability" />
27
+ </a>
28
+ </div>
29
+
30
+ <br>
4
31
 
5
32
  <img src="https://kompanee-public-assets.s3.amazonaws.com/readmes/ruby-progressbar-cage.png" align="right" />
6
33
 
7
- The **ultimate** text progress bar library for Ruby! It'll **SMASH YOU OVER THE HEAD** with a **PURE RUSH** of progress bar excitement!
34
+ The **ultimate** text progress bar library for Ruby! It'll **SMASH YOU OVER THE
35
+ HEAD** with a **PURE RUSH** of progress bar excitement!
8
36
 
9
- Don't miss out on what all the kids are talking about! If you want everyone to know that your gem or app can survive _in the cage_ then YOU WANT **RUBY-PROGRESSBAR**!
37
+ Don't miss out on what all the kids are talking about! If you want everyone to
38
+ know that your gem or app can survive _in the cage_ then YOU WANT
39
+ **RUBY-PROGRESSBAR**!
10
40
 
11
- <br><br><br>
41
+ <br>
12
42
 
13
- Full Reference
14
- --------------------------------
43
+ It's Better Than The Other 186,312 Progress Bar Libraries Because
44
+ --------------------------------------------------------------------------------
45
+
46
+ * It has [stood the test of time][history] (2008-today)
47
+
48
+ * Full test suite
49
+
50
+ * [_**ZERO**_ dependencies][gemspec]
51
+
52
+ * Used by [tons of other open source projects][dependencies] (which means we
53
+ find out about bugs quickly)
54
+
55
+ * It's pretty [freakin' sweet](https://www.youtube.com/watch?v=On3IoVhf_GM)
56
+
57
+ * And most importantly... our awesome [contributors][contributors]
58
+
59
+ Basic Usage
60
+ --------------------------------------------------------------------------------
15
61
 
16
- There's gotten to be too much awesome to pack into one page. Visit the [wiki](https://github.com/jfelchner/ruby-progressbar/wiki) for the full documentation.
62
+ ### Creation
17
63
 
18
- Here's a [quick link](https://github.com/jfelchner/ruby-progressbar/wiki/Basic-Usage) to the 'Basic Usage' section.
64
+ It's simple to get started:
65
+
66
+ ```ruby
67
+ progressbar = ProgressBar.create
68
+ ```
69
+
70
+ Creates a basic progress bar beginning at `0`, a maximum capacity of `100` and
71
+ tells it to start.
72
+
73
+ ```text
74
+ Progress: | |
75
+ ```
76
+
77
+ ### Marking Progress
78
+
79
+ Every call to `#increment` will advance the bar by `1`. Therefore:
80
+
81
+ ```ruby
82
+ 50.times { progressbar.increment }
83
+ ```
84
+
85
+ Would output an advancing line which would end up here:
86
+
87
+ ```text
88
+ Progress: |=================================== |
89
+ ```
90
+
91
+ ### Animation
92
+
93
+ ![Basic Usage Marking Progress](http://kompanee-public-assets.s3.amazonaws.com/readmes/ruby-progressbar-basic-usage-marking-progress-2.gif)
94
+
95
+ Full Reference
96
+ --------------------------------------------------------------------------------
97
+
98
+ There's gotten to be too much awesome to pack into one page. Visit the
99
+ [wiki][wiki] for the full documentation.
19
100
 
20
101
  Issues
21
- --------------------------------
102
+ --------------------------------------------------------------------------------
22
103
 
23
- If you have problems, please create a [Github issue](https://github.com/jfelchner/ruby-progressbar/issues).
104
+ If you have problems, please create a [Github issue][issues].
24
105
 
25
106
  Credits
26
- --------------------------------
107
+ --------------------------------------------------------------------------------
27
108
 
28
- ![The Kompanee](https://kompanee-public-assets.s3.amazonaws.com/readmes/kompanee-horizontal-black.png)
109
+ ![The Kompanee][kompanee-logo]
29
110
 
30
- ruby-progressbar is maintained by [The Kompanee, Ltd.](http://www.thekompanee.com)
111
+ ruby-progressbar is maintained by [The Kompanee, Ltd.][kompanee-site]
31
112
 
32
113
  The names and logos for The Kompanee are trademarks of The Kompanee, Ltd.
33
114
 
34
115
  License
35
- --------------------------------
116
+ --------------------------------------------------------------------------------
117
+
118
+ ruby-progressbar 1.0 is Copyright &copy; 2011-2021 The Kompanee. It is free
119
+ software, and may be redistributed under the terms specified in the LICENSE
120
+ file.
121
+ ruby-progressbar 0.9.0 is Copyright &copy; 2008 [Satoru Takabayashi][satoru]
36
122
 
37
- ruby-progressbar 1.0 is Copyright &copy; 2011-2019 The Kompanee. It is free software, and may be redistributed under the terms specified in the LICENSE file.
38
- ruby-progressbar 0.9.0 is Copyright &copy; 2008 [Satoru Takabayashi](http://0xcc.net)
123
+ [contributors]: https://github.com/jfelchner/ruby-progressbar/graphs/contributors
124
+ [dependencies]: https://github.com/jfelchner/ruby-progressbar/network/dependents
125
+ [gemspec]: https://github.com/jfelchner/ruby-progressbar/blob/master/ruby-progressbar.gemspec
126
+ [history]: https://github.com/jfelchner/ruby-progressbar/wiki/History
127
+ [issues]: https://github.com/jfelchner/ruby-progressbar/issues
128
+ [kompanee-logo]: https://kompanee-public-assets.s3.amazonaws.com/readmes/kompanee-horizontal-black.png
129
+ [kompanee-site]: http://www.thekompanee.com
130
+ [satoru]: http://0xcc.net
131
+ [wiki]: https://github.com/jfelchner/ruby-progressbar/wiki
@@ -13,7 +13,7 @@ class Base
13
13
  :progress,
14
14
  :total
15
15
 
16
- def initialize(options = {})
16
+ def initialize(options = {}) # rubocop:disable Metrics/AbcSize
17
17
  self.autostart = options.fetch(:autostart, true)
18
18
  self.autofinish = options.fetch(:autofinish, true)
19
19
  self.finished = false
@@ -123,7 +123,7 @@ class Base
123
123
  Format::Formatter.process(@format, output.length, self)
124
124
  end
125
125
 
126
- # rubocop:disable Metrics/AbcSize, Metrics/LineLength
126
+ # rubocop:disable Metrics/AbcSize, Layout/LineLength
127
127
  def to_h
128
128
  {
129
129
  'output_stream' => output.__send__(:stream),
@@ -145,7 +145,7 @@ class Base
145
145
  'finished?' => finished?
146
146
  }
147
147
  end
148
- # rubocop:enable Metrics/AbcSize, Metrics/LineLength
148
+ # rubocop:enable Metrics/AbcSize, Layout/LineLength
149
149
 
150
150
  def inspect
151
151
  "#<ProgressBar:#{progress}/#{total || 'unknown'}>"
@@ -12,6 +12,10 @@ class Time
12
12
  NO_TIME_ELAPSED_TEXT = '--:--:--'.freeze
13
13
  ESTIMATED_LABEL = ' ETA'.freeze
14
14
  ELAPSED_LABEL = 'Time'.freeze
15
+ OOB_TEXT_TO_FORMAT = {
16
+ :unknown => OOB_UNKNOWN_TIME_TEXT,
17
+ :friendly => OOB_FRIENDLY_TIME_TEXT
18
+ }.freeze
15
19
 
16
20
  def initialize(options = {})
17
21
  self.out_of_bounds_time_format = options[:out_of_bounds_time_format]
@@ -53,8 +57,7 @@ class Time
53
57
 
54
58
  def out_of_bounds_time_format=(format)
55
59
  unless OOB_TIME_FORMATS.include? format
56
- fail 'Invalid Out Of Bounds time format. Valid formats are ' +
57
- OOB_TIME_FORMATS.inspect
60
+ fail StandardError, "Invalid Out Of Bounds time format. Valid formats are #{OOB_TIME_FORMATS.inspect}"
58
61
  end
59
62
 
60
63
  @out_of_bounds_time_format = format
@@ -70,7 +73,7 @@ class Time
70
73
  hours, minutes, seconds = timer.divide_seconds(memo_estimated_seconds_remaining)
71
74
 
72
75
  if hours > OOB_LIMIT_IN_HOURS && out_of_bounds_time_format
73
- out_of_bounds_time
76
+ OOB_TEXT_TO_FORMAT[out_of_bounds_time_format]
74
77
  else
75
78
  TIME_FORMAT % [hours, minutes, seconds]
76
79
  end
@@ -89,19 +92,10 @@ class Time
89
92
  end
90
93
 
91
94
  def estimated_seconds_remaining
92
- return if progress.unknown? || progress.none? || timer.stopped?
95
+ return if progress.unknown? || progress.none? || timer.stopped? || timer.reset?
93
96
 
94
97
  (timer.elapsed_seconds * (progress.total / progress.running_average - 1)).round
95
98
  end
96
-
97
- def out_of_bounds_time
98
- case out_of_bounds_time_format
99
- when :unknown
100
- OOB_UNKNOWN_TIME_TEXT
101
- when :friendly
102
- OOB_FRIENDLY_TIME_TEXT
103
- end
104
- end
105
99
  end
106
100
  end
107
101
  end
@@ -29,7 +29,7 @@ class String < ::String
29
29
  end
30
30
 
31
31
  molecules
32
- end
32
+ end
33
33
  end
34
34
  end
35
35
  end
@@ -17,7 +17,7 @@ class Tty < Output
17
17
  end
18
18
 
19
19
  def default_format
20
- DEFAULT_FORMAT_STRING
20
+ ENV['RUBY_PROGRESS_BAR_FORMAT'] || DEFAULT_FORMAT_STRING
21
21
  end
22
22
 
23
23
  def resolve_format(other_format)
@@ -13,7 +13,7 @@ refine ::Enumerator do
13
13
  end
14
14
  end
15
15
 
16
- return chain unless block_given?
16
+ return chain unless block
17
17
 
18
18
  chain.each(&block)
19
19
  end
@@ -1,3 +1,3 @@
1
1
  class ProgressBar
2
- VERSION = '1.10.1'.freeze
2
+ VERSION = '1.11.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: progressbar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.1
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - thekompanee
8
8
  - jfelchner
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain:
12
12
  - |
13
13
  -----BEGIN CERTIFICATE-----
14
- MIIEdjCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADAyMTAwLgYDVQQDDCdhY2Nv
15
- dW50c19ydWJ5Z2Vtcy9EQz10aGVrb21wYW5lZS9EQz1jb20wHhcNMTgwODAzMjEz
16
- NDA1WhcNMTkwODAzMjEzNDA1WjAyMTAwLgYDVQQDDCdhY2NvdW50c19ydWJ5Z2Vt
14
+ MIIEGDCCAoCgAwIBAgIBAjANBgkqhkiG9w0BAQsFADAyMTAwLgYDVQQDDCdhY2Nv
15
+ dW50c19ydWJ5Z2Vtcy9EQz10aGVrb21wYW5lZS9EQz1jb20wHhcNMjAxMjI2MjIz
16
+ MTE2WhcNMjExMjI2MjIzMTE2WjAyMTAwLgYDVQQDDCdhY2NvdW50c19ydWJ5Z2Vt
17
17
  cy9EQz10aGVrb21wYW5lZS9EQz1jb20wggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAw
18
18
  ggGKAoIBgQCqhYn5ODEoLvuBIF2M1GzoaZU28+ntP5QApvDE0Te04n0JbBC1cNYH
19
19
  mr71neeSx7tlZ9w9kJ/8GNcY5bm7pNJqhyhfc+uG9M7FttcxM8AYXogjcdUDP234
@@ -23,20 +23,18 @@ cert_chain:
23
23
  ztMEU785tERbOSszZrz9rBS/+GnMxlD0pxy50zFfHX3jY1hwnwGjE8Gg+0iYr/tm
24
24
  eysjhcbZfKrMynoqAioCSwstIwtYYYYpYzCPZzwaIB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T5mqFSyFznVCjQAQygDnz6JkCQlIG93IDtVLEmHrx7hm3dOYt
29
+ HgPlsSgkoYIgsLYsR9ZIKjA2O5m3QUbo9uOtF4iRi0Obni8fVv7VZVebRfA7ypCo
30
+ n625lDRIzc/zGVcI37bzIlDXC0aK3oaBVFmN1Uj5LNMW62hTDdMBx4HcUKI45R3g
31
+ clUG96OBIyrYky3j6zpy6EpBaEdRWR68Yn4Tdba7xE9WzP3DCInjX3KPx+f0PPVK
32
+ HzsXX6TlwXk2P9DwOTZRjz7vAmvTgZGWjlfq3dgQJBgjB+UKQVHxKEGUC/comr7c
33
+ vPnXgn+nF38pK/hp/O9/lTpNplKrUvOB9+6nkwbxCPTQQO8In3pC6ixUzr/6wx9R
34
+ URbz4/Czf5LMUmzqDni0GvBkXElaXzaIRoPM/T7b1LrRsZO3DwGFAasSrR27+ZgU
35
+ Sv+7zM1SqVOK2Vhp99UBBVIZTHSJWh4sCU7dJrUJTqvwwS3ayTiUlIi5TdQ=
38
36
  -----END CERTIFICATE-----
39
- date: 2019-05-28 00:00:00.000000000 Z
37
+ date: 2020-12-31 00:00:00.000000000 Z
40
38
  dependencies:
41
39
  - !ruby/object:Gem::Dependency
42
40
  name: rspec
@@ -80,20 +78,6 @@ dependencies:
80
78
  - - "~>"
81
79
  - !ruby/object:Gem::Version
82
80
  version: '2.3'
83
- - !ruby/object:Gem::Dependency
84
- name: warning_filter
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: 0.0.6
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: 0.0.6
97
81
  - !ruby/object:Gem::Dependency
98
82
  name: timecop
99
83
  requirement: !ruby/object:Gem::Requirement
@@ -152,11 +136,11 @@ licenses:
152
136
  metadata:
153
137
  bug_tracker_uri: https://github.com/jfelchner/ruby-progressbar/issues
154
138
  changelog_uri: https://github.com/jfelchner/ruby-progressbar/blob/master/CHANGELOG.md
155
- documentation_uri: https://github.com/jfelchner/ruby-progressbar/tree/releases/v1.10.1
139
+ documentation_uri: https://github.com/jfelchner/ruby-progressbar/tree/releases/v1.11.0
156
140
  homepage_uri: https://github.com/jfelchner/ruby-progressbar
157
141
  source_code_uri: https://github.com/jfelchner/ruby-progressbar
158
142
  wiki_uri: https://github.com/jfelchner/ruby-progressbar/wiki
159
- post_install_message:
143
+ post_install_message:
160
144
  rdoc_options: []
161
145
  require_paths:
162
146
  - lib
@@ -171,8 +155,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
155
  - !ruby/object:Gem::Version
172
156
  version: '0'
173
157
  requirements: []
174
- rubygems_version: 3.0.3
175
- signing_key:
158
+ rubygems_version: 3.2.3
159
+ signing_key:
176
160
  specification_version: 4
177
161
  summary: Ruby/ProgressBar is a flexible text progress bar library for Ruby.
178
162
  test_files: []
metadata.gz.sig CHANGED
Binary file