ruby-progressbar 1.8.1 → 1.11.0
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 +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/LICENSE.txt +1 -1
- data/README.md +111 -18
- data/Rakefile +0 -0
- data/lib/ruby-progressbar.rb +5 -0
- data/lib/ruby-progressbar/base.rb +28 -4
- data/lib/ruby-progressbar/calculators/length.rb +14 -2
- data/lib/ruby-progressbar/components/bar.rb +7 -1
- data/lib/ruby-progressbar/components/time.rb +12 -14
- data/lib/ruby-progressbar/format/formatter.rb +1 -1
- data/lib/ruby-progressbar/format/molecule.rb +4 -2
- data/lib/ruby-progressbar/format/string.rb +3 -3
- data/lib/ruby-progressbar/output.rb +14 -7
- data/lib/ruby-progressbar/outputs/non_tty.rb +1 -1
- data/lib/ruby-progressbar/outputs/null.rb +33 -0
- data/lib/ruby-progressbar/outputs/tty.rb +1 -1
- data/lib/ruby-progressbar/progress.rb +23 -16
- data/lib/ruby-progressbar/refinements.rb +1 -0
- data/lib/ruby-progressbar/refinements/enumerator.rb +23 -0
- data/lib/ruby-progressbar/time.rb +7 -5
- data/lib/ruby-progressbar/timer.rb +1 -1
- data/lib/ruby-progressbar/version.rb +1 -1
- metadata +50 -98
- metadata.gz.sig +0 -0
- data/lib/ruby-progressbar/calculators/length_spec.rb +0 -9
- data/spec/fixtures/benchmark.rb +0 -28
- data/spec/ruby-progressbar/base_spec.rb +0 -949
- data/spec/ruby-progressbar/calculators/length_calculator_spec.rb +0 -17
- data/spec/ruby-progressbar/calculators/running_average_spec.rb +0 -19
- data/spec/ruby-progressbar/components/bar_spec.rb +0 -234
- data/spec/ruby-progressbar/components/percentage_spec.rb +0 -9
- data/spec/ruby-progressbar/components/rate_spec.rb +0 -9
- data/spec/ruby-progressbar/components/throttle_spec.rb +0 -157
- data/spec/ruby-progressbar/components/time_spec.rb +0 -307
- data/spec/ruby-progressbar/components/title_spec.rb +0 -12
- data/spec/ruby-progressbar/format/formatter_spec.rb +0 -9
- data/spec/ruby-progressbar/format/molecule_spec.rb +0 -30
- data/spec/ruby-progressbar/format/string_spec.rb +0 -9
- data/spec/ruby-progressbar/output_spec.rb +0 -7
- data/spec/ruby-progressbar/outputs/non_tty_spec.rb +0 -9
- data/spec/ruby-progressbar/outputs/tty_spec.rb +0 -9
- data/spec/ruby-progressbar/progress_spec.rb +0 -156
- data/spec/ruby-progressbar/time_spec.rb +0 -45
- data/spec/ruby-progressbar/timer_spec.rb +0 -7
- data/spec/spec_helper.rb +0 -6
- data/spec/support/time.rb +0 -17
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
require 'ruby-progressbar/output'
|
|
2
|
+
|
|
3
|
+
class ProgressBar
|
|
4
|
+
module Outputs
|
|
5
|
+
class Null < Output
|
|
6
|
+
alias refresh_with_format_change with_refresh
|
|
7
|
+
|
|
8
|
+
def clear; end
|
|
9
|
+
def log(_string); end
|
|
10
|
+
def refresh(*); end
|
|
11
|
+
|
|
12
|
+
def clear_string
|
|
13
|
+
''
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def bar_update_string
|
|
17
|
+
''
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def default_format
|
|
21
|
+
''
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def resolve_format(_format)
|
|
25
|
+
''
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def eol
|
|
29
|
+
''
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -35,17 +35,21 @@ class Progress
|
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
def increment
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
if progress == total
|
|
39
|
+
warn "WARNING: Your progress bar is currently at #{progress} out of #{total} " \
|
|
40
|
+
"and cannot be incremented. In v2.0.0 this will become a " \
|
|
41
|
+
"ProgressBar::InvalidProgressError."
|
|
42
|
+
end
|
|
41
43
|
|
|
42
44
|
self.progress += 1 unless progress == total
|
|
43
45
|
end
|
|
44
46
|
|
|
45
47
|
def decrement
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
if progress == 0
|
|
49
|
+
warn "WARNING: Your progress bar is currently at #{progress} out of #{total} " \
|
|
50
|
+
"and cannot be decremented. In v2.0.0 this will become a " \
|
|
51
|
+
"ProgressBar::InvalidProgressError."
|
|
52
|
+
end
|
|
49
53
|
|
|
50
54
|
self.progress -= 1 unless progress == 0
|
|
51
55
|
end
|
|
@@ -55,10 +59,10 @@ class Progress
|
|
|
55
59
|
end
|
|
56
60
|
|
|
57
61
|
def progress=(new_progress)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
if total && new_progress > total
|
|
63
|
+
fail ProgressBar::InvalidProgressError,
|
|
64
|
+
"You can't set the item's current value to be greater than the total."
|
|
65
|
+
end
|
|
62
66
|
|
|
63
67
|
@progress = new_progress
|
|
64
68
|
|
|
@@ -68,18 +72,17 @@ class Progress
|
|
|
68
72
|
end
|
|
69
73
|
|
|
70
74
|
def total=(new_total)
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
new_total >= progress
|
|
75
|
+
unless progress.nil? || new_total.nil? || new_total >= progress
|
|
76
|
+
fail ProgressBar::InvalidProgressError,
|
|
77
|
+
"You can't set the item's total value to less than the current progress."
|
|
78
|
+
end
|
|
76
79
|
|
|
77
80
|
@total = new_total
|
|
78
81
|
end
|
|
79
82
|
|
|
80
83
|
def percentage_completed
|
|
81
84
|
return 0 if total.nil?
|
|
82
|
-
return 100 if total
|
|
85
|
+
return 100 if total == 0
|
|
83
86
|
|
|
84
87
|
# progress / total * 100
|
|
85
88
|
#
|
|
@@ -97,6 +100,10 @@ class Progress
|
|
|
97
100
|
progress.nil? || total.nil?
|
|
98
101
|
end
|
|
99
102
|
|
|
103
|
+
def total_with_unknown_indicator
|
|
104
|
+
total || '??'
|
|
105
|
+
end
|
|
106
|
+
|
|
100
107
|
def percentage_completed_with_precision
|
|
101
108
|
return 100.0 if total == 0
|
|
102
109
|
return 0.0 if total.nil?
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require 'ruby-progressbar/refinements/enumerator'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
class ProgressBar
|
|
2
|
+
module Refinements
|
|
3
|
+
module Enumerator
|
|
4
|
+
refine ::Enumerator do
|
|
5
|
+
def with_progressbar(options = {}, &block)
|
|
6
|
+
chain = ::Enumerator.new do |yielder|
|
|
7
|
+
progress_bar = ProgressBar.create(options.merge(:starting_at => 0, :total => size))
|
|
8
|
+
|
|
9
|
+
each do |*args|
|
|
10
|
+
yielder.yield(*args).tap do
|
|
11
|
+
progress_bar.increment
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
return chain unless block
|
|
17
|
+
|
|
18
|
+
chain.each(&block)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
# rubocop:disable Style/InlineComment
|
|
1
2
|
class ProgressBar
|
|
2
3
|
class Time
|
|
3
4
|
TIME_MOCKING_LIBRARY_METHODS = [
|
|
4
|
-
:__simple_stub__now,
|
|
5
|
-
:now_without_mock_time,
|
|
6
|
-
:now_without_delorean,
|
|
7
|
-
:now
|
|
5
|
+
:__simple_stub__now, # ActiveSupport
|
|
6
|
+
:now_without_mock_time, # Timecop
|
|
7
|
+
:now_without_delorean, # Delorean
|
|
8
|
+
:now # Unmocked
|
|
8
9
|
].freeze
|
|
9
10
|
|
|
10
11
|
def initialize(time = ::Time)
|
|
@@ -12,7 +13,7 @@ class Time
|
|
|
12
13
|
end
|
|
13
14
|
|
|
14
15
|
def now
|
|
15
|
-
time.__send__
|
|
16
|
+
time.__send__(unmocked_time_method)
|
|
16
17
|
end
|
|
17
18
|
|
|
18
19
|
def unmocked_time_method
|
|
@@ -28,3 +29,4 @@ class Time
|
|
|
28
29
|
attr_accessor :time
|
|
29
30
|
end
|
|
30
31
|
end
|
|
32
|
+
# rubocop:enable Style/InlineComment
|
metadata
CHANGED
|
@@ -1,38 +1,40 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby-progressbar
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
14
|
+
MIIEGDCCAoCgAwIBAgIBAjANBgkqhkiG9w0BAQsFADAyMTAwLgYDVQQDDCdhY2Nv
|
|
15
|
+
dW50c19ydWJ5Z2Vtcy9EQz10aGVrb21wYW5lZS9EQz1jb20wHhcNMjAxMjI2MjIz
|
|
16
|
+
MTE2WhcNMjExMjI2MjIzMTE2WjAyMTAwLgYDVQQDDCdhY2NvdW50c19ydWJ5Z2Vt
|
|
17
|
+
cy9EQz10aGVrb21wYW5lZS9EQz1jb20wggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAw
|
|
18
|
+
ggGKAoIBgQCqhYn5ODEoLvuBIF2M1GzoaZU28+ntP5QApvDE0Te04n0JbBC1cNYH
|
|
19
|
+
mr71neeSx7tlZ9w9kJ/8GNcY5bm7pNJqhyhfc+uG9M7FttcxM8AYXogjcdUDP234
|
|
20
|
+
+TdmZIz20JxtWBgAZK2I3ktlgLFLC3Pxq63yzhJ75Xok07Wh+ypwjGzDNofPhz+y
|
|
21
|
+
XR+UeUTp2UGe7kDVoqu/AwwPVhk1qUIRFLfC8SLDTD0CuNW3/AnkwQrKSm8vkiIn
|
|
22
|
+
q9GCnOq0+jQly0b6a1Gi3ZDYEEswnTzziw2gotUZnQkF5bcOcxK1CB/Okk2jtG7i
|
|
23
|
+
ztMEU785tERbOSszZrz9rBS/+GnMxlD0pxy50zFfHX3jY1hwnwGjE8Gg+0iYr/tm
|
|
24
|
+
eysjhcbZfKrMynoqAioCSwstIwtYYYYpYzCPZzwaIBaBqQmUTkuMeiGbAdOdFOrR
|
|
25
|
+
lOgl5jxCYbNOOTaXbm0nGBFaTucB88+JLbsNAuoNGUf/ybDcZ1zKRkMr2vtb+OtL
|
|
26
|
+
GoP81fN6l88CAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0O
|
|
27
|
+
BBYEFC+HleDjPYe35DNu6n/aeK2oB4ugMA0GCSqGSIb3DQEBCwUAA4IBgQCbuxKj
|
|
28
|
+
ZyvFu5mUDEWCf1dT5mqFSyFznVCjQAQygDnz6JkCQlIG93IDtVLEmHrx7hm3dOYt
|
|
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=
|
|
34
36
|
-----END CERTIFICATE-----
|
|
35
|
-
date:
|
|
37
|
+
date: 2020-12-31 00:00:00.000000000 Z
|
|
36
38
|
dependencies:
|
|
37
39
|
- !ruby/object:Gem::Dependency
|
|
38
40
|
name: rspec
|
|
@@ -40,14 +42,14 @@ dependencies:
|
|
|
40
42
|
requirements:
|
|
41
43
|
- - "~>"
|
|
42
44
|
- !ruby/object:Gem::Version
|
|
43
|
-
version: '3.
|
|
45
|
+
version: '3.7'
|
|
44
46
|
type: :development
|
|
45
47
|
prerelease: false
|
|
46
48
|
version_requirements: !ruby/object:Gem::Requirement
|
|
47
49
|
requirements:
|
|
48
50
|
- - "~>"
|
|
49
51
|
- !ruby/object:Gem::Version
|
|
50
|
-
version: '3.
|
|
52
|
+
version: '3.7'
|
|
51
53
|
- !ruby/object:Gem::Dependency
|
|
52
54
|
name: rspectacular
|
|
53
55
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -68,47 +70,33 @@ dependencies:
|
|
|
68
70
|
requirements:
|
|
69
71
|
- - "~>"
|
|
70
72
|
- !ruby/object:Gem::Version
|
|
71
|
-
version: '2.
|
|
73
|
+
version: '2.3'
|
|
72
74
|
type: :development
|
|
73
75
|
prerelease: false
|
|
74
76
|
version_requirements: !ruby/object:Gem::Requirement
|
|
75
77
|
requirements:
|
|
76
78
|
- - "~>"
|
|
77
79
|
- !ruby/object:Gem::Version
|
|
78
|
-
version: '2.
|
|
79
|
-
- !ruby/object:Gem::Dependency
|
|
80
|
-
name: warning_filter
|
|
81
|
-
requirement: !ruby/object:Gem::Requirement
|
|
82
|
-
requirements:
|
|
83
|
-
- - "~>"
|
|
84
|
-
- !ruby/object:Gem::Version
|
|
85
|
-
version: 0.0.2
|
|
86
|
-
type: :development
|
|
87
|
-
prerelease: false
|
|
88
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
89
|
-
requirements:
|
|
90
|
-
- - "~>"
|
|
91
|
-
- !ruby/object:Gem::Version
|
|
92
|
-
version: 0.0.2
|
|
80
|
+
version: '2.3'
|
|
93
81
|
- !ruby/object:Gem::Dependency
|
|
94
82
|
name: timecop
|
|
95
83
|
requirement: !ruby/object:Gem::Requirement
|
|
96
84
|
requirements:
|
|
97
85
|
- - '='
|
|
98
86
|
- !ruby/object:Gem::Version
|
|
99
|
-
version: 0.6.
|
|
87
|
+
version: 0.6.0
|
|
100
88
|
type: :development
|
|
101
89
|
prerelease: false
|
|
102
90
|
version_requirements: !ruby/object:Gem::Requirement
|
|
103
91
|
requirements:
|
|
104
92
|
- - '='
|
|
105
93
|
- !ruby/object:Gem::Version
|
|
106
|
-
version: 0.6.
|
|
107
|
-
description:
|
|
108
|
-
Ruby
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
94
|
+
version: 0.6.0
|
|
95
|
+
description: 'Ruby/ProgressBar is an extremely flexible text progress bar library
|
|
96
|
+
for Ruby. The output can be customized with a flexible formatting system including:
|
|
97
|
+
percentage, bars of various formats, elapsed time and estimated time remaining.'
|
|
98
|
+
email:
|
|
99
|
+
- support@thekompanee.com
|
|
112
100
|
executables: []
|
|
113
101
|
extensions: []
|
|
114
102
|
extra_rdoc_files: []
|
|
@@ -119,7 +107,6 @@ files:
|
|
|
119
107
|
- lib/ruby-progressbar.rb
|
|
120
108
|
- lib/ruby-progressbar/base.rb
|
|
121
109
|
- lib/ruby-progressbar/calculators/length.rb
|
|
122
|
-
- lib/ruby-progressbar/calculators/length_spec.rb
|
|
123
110
|
- lib/ruby-progressbar/calculators/running_average.rb
|
|
124
111
|
- lib/ruby-progressbar/components.rb
|
|
125
112
|
- lib/ruby-progressbar/components/bar.rb
|
|
@@ -134,38 +121,26 @@ files:
|
|
|
134
121
|
- lib/ruby-progressbar/format/string.rb
|
|
135
122
|
- lib/ruby-progressbar/output.rb
|
|
136
123
|
- lib/ruby-progressbar/outputs/non_tty.rb
|
|
124
|
+
- lib/ruby-progressbar/outputs/null.rb
|
|
137
125
|
- lib/ruby-progressbar/outputs/tty.rb
|
|
138
126
|
- lib/ruby-progressbar/progress.rb
|
|
127
|
+
- lib/ruby-progressbar/refinements.rb
|
|
128
|
+
- lib/ruby-progressbar/refinements/enumerator.rb
|
|
139
129
|
- lib/ruby-progressbar/throttle.rb
|
|
140
130
|
- lib/ruby-progressbar/time.rb
|
|
141
131
|
- lib/ruby-progressbar/timer.rb
|
|
142
132
|
- lib/ruby-progressbar/version.rb
|
|
143
|
-
- spec/fixtures/benchmark.rb
|
|
144
|
-
- spec/ruby-progressbar/base_spec.rb
|
|
145
|
-
- spec/ruby-progressbar/calculators/length_calculator_spec.rb
|
|
146
|
-
- spec/ruby-progressbar/calculators/running_average_spec.rb
|
|
147
|
-
- spec/ruby-progressbar/components/bar_spec.rb
|
|
148
|
-
- spec/ruby-progressbar/components/percentage_spec.rb
|
|
149
|
-
- spec/ruby-progressbar/components/rate_spec.rb
|
|
150
|
-
- spec/ruby-progressbar/components/throttle_spec.rb
|
|
151
|
-
- spec/ruby-progressbar/components/time_spec.rb
|
|
152
|
-
- spec/ruby-progressbar/components/title_spec.rb
|
|
153
|
-
- spec/ruby-progressbar/format/formatter_spec.rb
|
|
154
|
-
- spec/ruby-progressbar/format/molecule_spec.rb
|
|
155
|
-
- spec/ruby-progressbar/format/string_spec.rb
|
|
156
|
-
- spec/ruby-progressbar/output_spec.rb
|
|
157
|
-
- spec/ruby-progressbar/outputs/non_tty_spec.rb
|
|
158
|
-
- spec/ruby-progressbar/outputs/tty_spec.rb
|
|
159
|
-
- spec/ruby-progressbar/progress_spec.rb
|
|
160
|
-
- spec/ruby-progressbar/time_spec.rb
|
|
161
|
-
- spec/ruby-progressbar/timer_spec.rb
|
|
162
|
-
- spec/spec_helper.rb
|
|
163
|
-
- spec/support/time.rb
|
|
164
133
|
homepage: https://github.com/jfelchner/ruby-progressbar
|
|
165
134
|
licenses:
|
|
166
135
|
- MIT
|
|
167
|
-
metadata:
|
|
168
|
-
|
|
136
|
+
metadata:
|
|
137
|
+
bug_tracker_uri: https://github.com/jfelchner/ruby-progressbar/issues
|
|
138
|
+
changelog_uri: https://github.com/jfelchner/ruby-progressbar/blob/master/CHANGELOG.md
|
|
139
|
+
documentation_uri: https://github.com/jfelchner/ruby-progressbar/tree/releases/v1.11.0
|
|
140
|
+
homepage_uri: https://github.com/jfelchner/ruby-progressbar
|
|
141
|
+
source_code_uri: https://github.com/jfelchner/ruby-progressbar
|
|
142
|
+
wiki_uri: https://github.com/jfelchner/ruby-progressbar/wiki
|
|
143
|
+
post_install_message:
|
|
169
144
|
rdoc_options: []
|
|
170
145
|
require_paths:
|
|
171
146
|
- lib
|
|
@@ -180,31 +155,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
180
155
|
- !ruby/object:Gem::Version
|
|
181
156
|
version: '0'
|
|
182
157
|
requirements: []
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
signing_key:
|
|
158
|
+
rubygems_version: 3.2.3
|
|
159
|
+
signing_key:
|
|
186
160
|
specification_version: 4
|
|
187
161
|
summary: Ruby/ProgressBar is a flexible text progress bar library for Ruby.
|
|
188
|
-
test_files:
|
|
189
|
-
- spec/fixtures/benchmark.rb
|
|
190
|
-
- spec/ruby-progressbar/base_spec.rb
|
|
191
|
-
- spec/ruby-progressbar/calculators/length_calculator_spec.rb
|
|
192
|
-
- spec/ruby-progressbar/calculators/running_average_spec.rb
|
|
193
|
-
- spec/ruby-progressbar/components/bar_spec.rb
|
|
194
|
-
- spec/ruby-progressbar/components/percentage_spec.rb
|
|
195
|
-
- spec/ruby-progressbar/components/rate_spec.rb
|
|
196
|
-
- spec/ruby-progressbar/components/throttle_spec.rb
|
|
197
|
-
- spec/ruby-progressbar/components/time_spec.rb
|
|
198
|
-
- spec/ruby-progressbar/components/title_spec.rb
|
|
199
|
-
- spec/ruby-progressbar/format/formatter_spec.rb
|
|
200
|
-
- spec/ruby-progressbar/format/molecule_spec.rb
|
|
201
|
-
- spec/ruby-progressbar/format/string_spec.rb
|
|
202
|
-
- spec/ruby-progressbar/output_spec.rb
|
|
203
|
-
- spec/ruby-progressbar/outputs/non_tty_spec.rb
|
|
204
|
-
- spec/ruby-progressbar/outputs/tty_spec.rb
|
|
205
|
-
- spec/ruby-progressbar/progress_spec.rb
|
|
206
|
-
- spec/ruby-progressbar/time_spec.rb
|
|
207
|
-
- spec/ruby-progressbar/timer_spec.rb
|
|
208
|
-
- spec/spec_helper.rb
|
|
209
|
-
- spec/support/time.rb
|
|
210
|
-
has_rdoc:
|
|
162
|
+
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|
data/spec/fixtures/benchmark.rb
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# bundle exec ruby-prof --printer=graph_html
|
|
2
|
-
# --file=../results.html
|
|
3
|
-
# --require 'ruby-progressbar'
|
|
4
|
-
# --sort=total ./spec/fixtures/benchmark.rb
|
|
5
|
-
|
|
6
|
-
total = 100_000
|
|
7
|
-
# output = File.open('/Users/jfelchner/Downloads/benchmark.txt', 'w+')
|
|
8
|
-
output = $stdout
|
|
9
|
-
|
|
10
|
-
# Progressbar gem
|
|
11
|
-
# bar = ProgressBar.new('Progress', total)
|
|
12
|
-
#
|
|
13
|
-
# total.times do |i|
|
|
14
|
-
# bar.inc
|
|
15
|
-
# end
|
|
16
|
-
#
|
|
17
|
-
# bar.finish
|
|
18
|
-
|
|
19
|
-
# Ruby/ProgressBar
|
|
20
|
-
bar = ProgressBar.create(:output => output,
|
|
21
|
-
:length => 80,
|
|
22
|
-
:start => 0,
|
|
23
|
-
:total => total)
|
|
24
|
-
|
|
25
|
-
total.times do |_i|
|
|
26
|
-
# bar.log i
|
|
27
|
-
bar.increment
|
|
28
|
-
end
|