2019-11-17 20:25:42 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class RakeHelpers
|
|
|
|
def self.print_status_with_label(label, current, max)
|
2020-02-18 00:08:58 -05:00
|
|
|
return if Rails.env.test? && !ENV['RAILS_ENABLE_TEST_LOG']
|
2019-11-17 20:25:42 -05:00
|
|
|
print "\r\033[K%s%9d / %d (%5.1f%%)" % [label, current, max, ((current.to_f / max.to_f) * 100).round(1)]
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.print_status(current, max)
|
2020-02-18 00:08:58 -05:00
|
|
|
return if Rails.env.test? && !ENV['RAILS_ENABLE_TEST_LOG']
|
2019-11-17 20:25:42 -05:00
|
|
|
print "\r\033[K%9d / %d (%5.1f%%)" % [current, max, ((current.to_f / max.to_f) * 100).round(1)]
|
|
|
|
end
|
|
|
|
end
|