Sha256: 2c674188ea3f11133aa6e47dc24661eff2b91cbbf97fc93863b59603d3313329

Contents?: true

Size: 488 Bytes

Versions: 3

Compression:

Stored size: 488 Bytes

Contents

module Ufo::Utils
  module Pretty
    def pretty_path(path)
      path.sub("#{Ufo.root}/",'').sub(/^\.\//,'')
    end

    # 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
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ufo-6.0.2 lib/ufo/utils/pretty.rb
ufo-6.0.1 lib/ufo/utils/pretty.rb
ufo-6.0.0 lib/ufo/utils/pretty.rb