mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 10:24:27 +08:00
14 lines
495 B
Ruby
14 lines
495 B
Ruby
# frozen_string_literal: true
|
|
|
|
class RakeHelpers
|
|
def self.print_status_with_label(label, current, max)
|
|
return if Rails.env.test? && !ENV['RAILS_ENABLE_TEST_LOG']
|
|
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)
|
|
return if Rails.env.test? && !ENV['RAILS_ENABLE_TEST_LOG']
|
|
print "\r\033[K%9d / %d (%5.1f%%)" % [current, max, ((current.to_f / max.to_f) * 100).round(1)]
|
|
end
|
|
end
|