Sha256: b0deafd012ac54ccdee248c13938a0a37fae75a3c01eaafa3c0e9be54598ae2a
Contents?: true
Size: 543 Bytes
Versions: 71
Compression:
Stored size: 543 Bytes
Contents
module Terraspace::Util module Pretty # http://stackoverflow.com/questions/4175733/convert-duration-to-hoursminutesseconds-or-similar-in-rails-3-or-ruby def pretty_time(total_seconds) minutes = (total_seconds / 60) % 60 seconds = total_seconds % 60 if total_seconds < 60 "#{seconds.to_i}s" else "#{minutes.to_i}m #{seconds.to_i}s" end end def pretty_path(path) return path if ENV['TS_TEST'] path.sub("#{Terraspace.root}/",'').sub(ENV['HOME'], '~') end end end
Version data entries
71 entries across 71 versions & 1 rubygems