Sha256: ba0742e414037aef6a2bde1a78e4daa4ce12af2f4a41c2f31934d146c192a9c6
Contents?: true
Size: 509 Bytes
Versions: 25
Compression:
Stored size: 509 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) ENV['TS_TEST'] ? path : path.sub("#{Terraspace.root}/",'') end end end
Version data entries
25 entries across 25 versions & 1 rubygems