progressbar 1.8.1 → 1.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/ruby-progressbar/components/rate.rb +1 -1
- data/lib/ruby-progressbar/format/formatter.rb +1 -1
- data/lib/ruby-progressbar/version.rb +1 -1
- data/spec/ruby-progressbar/calculators/length_calculator_spec.rb +7 -5
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 678eaa389d64f29d8b48c5e8086549021feaecd2
|
4
|
+
data.tar.gz: afdb30e1a504db901364de5e5852fb59ded7b6b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae05fc8f39070630e8df1b3c1a0ff5137a3f7363a2e492441512409e2150aa115f611ec1957a3b3558994bd26a4e7d4b104ed19fe4343f3d0b47cf2714d76f49
|
7
|
+
data.tar.gz: 46e580fa131be5aa76694f56bf3b3664ae20c8ec1c47323a648696f679aea312f54a777ee4c47db2acd9662dc15491a335438bda86204bc50d099fa4771bc7c9
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
@@ -13,7 +13,7 @@ class Formatter
|
|
13
13
|
bar_length = max_length -
|
14
14
|
processed_string.displayable_length +
|
15
15
|
format_string.bar_molecule_placeholder_length
|
16
|
-
bar_length = bar_length
|
16
|
+
bar_length = bar_length < 0 ? 0 : bar_length
|
17
17
|
|
18
18
|
format_string.bar_molecules.each do |molecule|
|
19
19
|
processed_string.gsub!(molecule.full_key,
|
@@ -4,13 +4,15 @@ require 'ruby-progressbar/calculators/running_average'
|
|
4
4
|
class ProgressBar
|
5
5
|
module Calculators
|
6
6
|
RSpec.describe Length do
|
7
|
-
|
8
|
-
|
7
|
+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('1.9.3')
|
8
|
+
it 'can properly calculate the length even if IO.console is nil' do
|
9
|
+
calculator = Length.new
|
9
10
|
|
10
|
-
|
11
|
-
|
11
|
+
expect(IO).to receive(:console).and_return nil
|
12
|
+
expect(calculator).to receive(:dynamic_width_via_system_calls).and_return 123_456
|
12
13
|
|
13
|
-
|
14
|
+
expect(calculator.calculate_length).to eql 123_456
|
15
|
+
end
|
14
16
|
end
|
15
17
|
end
|
16
18
|
end
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|