7even / zodiac

A small gem for calculating zodiac sign from a date of birth
7even.github.com/zodiac
44 stars 22 forks source link

Bug on starsign on leap year #5

Closed BastienDuplessier closed 12 years ago

BastienDuplessier commented 12 years ago

Hello !

I found a bug in your gem. I was trying to get the starsign of 02/29 but I got an error.

invalid date zodiac (0.2.3) lib/zodiac/finder.rb:7:in `new'

I fixed that in this pull request.

It was the YEAR constant. 2011 isn't a leap year and DateTime.new raise an error when asking datetime on 2011/02/29 (witch doesn't exist).

Regards,

Bastien.

7even commented 12 years ago

Yes, it was my mistake from the beginning. Year of the date wasn't supposed to affect the zodiac sign, so I just took the current year.

Thank you for the contribution! Merged and released.