Finally - a useful way of measuring time in your applications.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install useful_duration
> require 'useful_duration' > include UsefulDuration > 10.in_a_gadda_da_vidas.ago => 2013-04-18 11:25:56 -0400 > 2.bravehearts.from_now => 2013-04-18 20:10:45 -0400
Built in Durations
Defining Your Own Duration
> require 'useful_duration' > include UsefulDuration > useful_duration :fortnights, 1209600 > 1.fortnight.from_now => 2013-07-21 08:47:37 -0400
This requires ActiveSupport to play nicely with ActiveSupport duration. It was written against 3.2.13 and hasn't been regression tested against other versions.
Is there a unit of time you'd like to see?
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request