jmettraux/rufus-scheduler — pull request #56 by AimeeRose (2013-05-28 18:50:28+00:00)
Title: Change hours range to 23 and refactor specs

This PR revises the hours range to 0..23 in the Rufus::CronLine class.

Rufus::CronLine#next_time algorithm hangs when @hours = [24]. Example:

```
irb> require 'rufus-scheduler'
=> true
irb> c = Rufus::CronLine.new("0 24 * * *")
=> #
irb(main):004:0> c.next_time # this will loop forever
```

This is not a problem if at least one valid value for @hours is provided (@hours = [0,24]). However it is misleading because cron jobs will run once less than the length of the @hours array.

This issue is resolved by because all values greater than 23 are rounded down to 23 and #next_time runs as expected for that value.