Skip to content

Commit

Permalink
Fix: Predicates not available on 1.8.7
Browse files Browse the repository at this point in the history
  • Loading branch information
jfelchner committed Dec 10, 2016
1 parent 14db0ab commit 103e6e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/ruby-progressbar/components/rate.rb
Expand Up @@ -18,7 +18,7 @@ def initialize(options = {})
private

def rate_of_change(format_string = '%i')
return 0 unless elapsed_seconds.positive?
return 0 unless elapsed_seconds > 0

format_string % scaled_rate
end
Expand Down
2 changes: 1 addition & 1 deletion lib/ruby-progressbar/format/formatter.rb
Expand Up @@ -13,7 +13,7 @@ def self.process(format_string, max_length, bar)
bar_length = max_length -
processed_string.displayable_length +
format_string.bar_molecule_placeholder_length
bar_length = bar_length.negative? ? 0 : bar_length
bar_length = bar_length < 0 ? 0 : bar_length

format_string.bar_molecules.each do |molecule|
processed_string.gsub!(molecule.full_key,
Expand Down

0 comments on commit 103e6e1

Please sign in to comment.