lib/sidekiq/throttled/web/stats.rb in sidekiq-throttled-0.15.1 vs lib/sidekiq/throttled/web/stats.rb in sidekiq-throttled-0.16.0
- old
+ new
@@ -35,11 +35,12 @@
# @return [String]
def colorize_count(int, max)
percentile = 100.00 * int / max
lvl = if 80 <= percentile then "danger"
elsif 60 <= percentile then "warning"
- else "success"
+ else
+ "success"
end
%(<span class="label label-#{lvl}">#{int}</span>)
end
@@ -59,13 +60,13 @@
arr.join " "
end
# @return [String]
def humanize_integer(int)
- digits = int.to_s.split ""
- str = digits.shift(digits.count % 3).join("")
+ digits = int.to_s.chars
+ str = digits.shift(digits.count % 3).join
- str << " " << digits.shift(3).join("") while digits.count.positive?
+ str << " " << digits.shift(3).join while digits.count.positive?
str.strip
end
end
end