class DeployNanny::TimeFormatter
Public Class Methods
new(progress)
click to toggle source
# File lib/deploy_nanny.rb, line 64 def initialize(progress) @progress = progress end
Public Instance Methods
format(value)
click to toggle source
# File lib/deploy_nanny.rb, line 72 def format(value) time = Time.at((DeployNanny.sweep_rest - @progress.current)).utc.strftime("%M:%S") formatted_str = "Time remaining before next sweep and deploy: #{time}".yellow value.gsub(/:time/, formatted_str) end
matches?(value)
click to toggle source
# File lib/deploy_nanny.rb, line 68 def matches?(value) value.to_s =~ /:time/ end