josedonizetti / ruby-duration

Immutable type that represents some amount of time with accuracy in seconds.
http://bit.ly/ruby-duration
MIT License
124 stars 23 forks source link

Fix negatives #26

Closed smcabrera closed 3 years ago

smcabrera commented 9 years ago

I fixed the way that negatives behave in mathematical operations. I also added unit tests for each of the mathematical operations to test working properly with negatives.

I toyed with changing total to be stored as a negative number (total: -5) but I decided that you probably have a good reason for using the negative boolean for tracking whether or not the duration is negative so the only changes I made were in the mathematical operations. It's not that DRY, but I wanted to send you a first run and see what you thought.

I only changed the ruby version so that I could test on my machine. That should be in a separate commit which you can remove.

AugustoGu commented 8 years ago

:+1: Good Job. This project seems to be stopped. :(

peleteiro commented 8 years ago

It kinda did. Do you want to take over the project?

AugustoGu commented 8 years ago

I think that @smcabrera is the ideal person for this. :D

smcabrera commented 8 years ago

@peleteiro @AugustoGu I'd be happy to :-)

smcabrera commented 8 years ago

stephen.m.cabrera@gmail.com

Sent from my iPad

On Dec 18, 2015, at 07:23, Jose Peleteiro notifications@github.com wrote:

@smcabrera Which email address do you use for rubygems.org?

— Reply to this email directly or view it on GitHub.

peleteiro commented 8 years ago

@smcabrera Added you as owner on rubygem.org using stephen.m.cabrera@gmail.com.

Good luck with ruby-duration and fell free to make any change you want to. ;) thanks