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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 961db6323b945f7b6373152fb44363bfd8a6ac51
4
- data.tar.gz: 379bef4d424ce616f2f7b98e0de4881474d3c636
3
+ metadata.gz: 678eaa389d64f29d8b48c5e8086549021feaecd2
4
+ data.tar.gz: afdb30e1a504db901364de5e5852fb59ded7b6b6
5
5
  SHA512:
6
- metadata.gz: 45799ecf9e67670603bb0cbeb959508fbe148a30681d07c5dff599b8fb3ee9aefa06d1ac24f42552977b463760340d83724b0d4193297ffa60dcf49654d10084
7
- data.tar.gz: 60430265e9174a0fe0a1484986d956683b8dea789683fb78c7956852bf9c5759b569d6e476ad0c6871084f32ee27ff43fd274a598985722e0d1d870870c6c90d
6
+ metadata.gz: ae05fc8f39070630e8df1b3c1a0ff5137a3f7363a2e492441512409e2150aa115f611ec1957a3b3558994bd26a4e7d4b104ed19fe4343f3d0b47cf2714d76f49
7
+ data.tar.gz: 46e580fa131be5aa76694f56bf3b3664ae20c8ec1c47323a648696f679aea312f54a777ee4c47db2acd9662dc15491a335438bda86204bc50d099fa4771bc7c9
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -18,7 +18,7 @@ class Rate
18
18
  private
19
19
 
20
20
  def rate_of_change(format_string = '%i')
21
- return 0 unless elapsed_seconds.positive?
21
+ return 0 unless elapsed_seconds > 0
22
22
 
23
23
  format_string % scaled_rate
24
24
  end
@@ -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.negative? ? 0 : 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,
@@ -1,3 +1,3 @@
1
1
  class ProgressBar
2
- VERSION = '1.8.1'.freeze
2
+ VERSION = '1.8.2'.freeze
3
3
  end
@@ -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
- it 'can properly calculate the length even if IO.console is nil' do
8
- calculator = Length.new
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
- expect(IO).to receive(:console).and_return nil
11
- expect(calculator).to receive(:dynamic_width_via_system_calls).and_return 123_456
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
- expect(calculator.calculate_length).to eql 123_456
14
+ expect(calculator.calculate_length).to eql 123_456
15
+ end
14
16
  end
15
17
  end
16
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: progressbar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - thekompanee
metadata.gz.sig CHANGED
Binary file