Skip to content

yegor256/tago

Repository files navigation

Adds .ago() Method to the Time Class

DevOps By Rultor.com We recommend RubyMine

rake PDD status Gem Version Test Coverage Yard Docs Hits-of-Code License

First, install it:

gem install tago

Here is how you use it:

start = Time.now
# something long
puts "It took #{start.ago} to do it"

It's also possible to convert Float seconds to text:

s = Time.now - start
puts "It took #{s.seconds}"

The gem basically extends the Float and Time classes with new methods.

How to contribute

Read these guidelines. Make sure your build is green before you contribute your pull request. You will need to have Ruby 3.2+ and Bundler installed. Then:

bundle update
bundle exec rake

If it's clean and you don't see any error messages, submit your pull request.

About

Convenient .ago() and .seconds() helpers for Ruby’s Time and String classes

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •  

Languages