Sha256: e9fdc03fe080d3b2419d259bf217cf2322b29811efb408f6eda4008ed6cee3a7
Contents?: true
Size: 600 Bytes
Versions: 165
Compression:
Stored size: 600 Bytes
Contents
module KnapsackPro class Presenter class << self def global_time global_time = pretty_seconds(KnapsackPro.tracker.global_time) "Global time execution for tests: #{global_time}" end def pretty_seconds(seconds) sign = '' if seconds < 0 seconds = seconds*-1 sign = '-' end return "#{sign}#{seconds}s" if seconds.abs < 1 time = Time.at(seconds).gmtime.strftime('%Hh %Mm %Ss') time_without_zeros = time.gsub(/00(h|m|s)/, '').strip sign + time_without_zeros end end end end
Version data entries
165 entries across 165 versions & 1 rubygems