Sha256: bbcaf20c2a3bbf0f166e93fe12e53e42abf281826dc3fb06ede189a73f7df67b

Contents?: true

Size: 402 Bytes

Versions: 58

Compression:

Stored size: 402 Bytes

Contents

module Kubes::Util
  module Time
    # 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

58 entries across 58 versions & 1 rubygems

Version Path
kubes-0.9.3 lib/kubes/util/time.rb
kubes-0.9.2 lib/kubes/util/time.rb
kubes-0.9.1 lib/kubes/util/time.rb
kubes-0.9.0 lib/kubes/util/time.rb
kubes-0.8.10 lib/kubes/util/time.rb
kubes-0.8.9 lib/kubes/util/time.rb
kubes-0.8.8 lib/kubes/util/time.rb
kubes-0.8.7 lib/kubes/util/time.rb
kubes-0.8.6 lib/kubes/util/time.rb
kubes-0.8.5 lib/kubes/util/time.rb
kubes-0.8.4 lib/kubes/util/time.rb
kubes-0.8.3 lib/kubes/util/time.rb
kubes-0.8.2 lib/kubes/util/time.rb
kubes-0.8.1 lib/kubes/util/time.rb
kubes-0.8.0 lib/kubes/util/time.rb
kubes-0.7.10 lib/kubes/util/time.rb
kubes-0.7.9 lib/kubes/util/time.rb
kubes-0.7.8 lib/kubes/util/time.rb
kubes-0.7.7 lib/kubes/util/time.rb
kubes-0.7.6 lib/kubes/util/time.rb