Over the past few days, I’ve wrapped up a new release of IceCube, and I wanted to share some of the changes and optimizations that came out of it.

One really exciting byproduct of the transition is that it allows for inline computation of occurrences for a schedule:

schedule = IceCube::Schedule.new
schedule.add_recurrence_rule IceCube::Rule.weekly
schedule.each_occurrence do |time|
  puts "oh yeah boyeee - it happens on #{time}"
end

This is all possible because of another change.. Instead of having Rules and Validations as separate concepts, they’ve been merged into one, in addition to making things like add_recurrence_rule just add a SingleRecurrenceRule. This has simplified the code a lot, and the previously-existing spec suite fully passes.

These changes are great for the library, and I’m excited to see them head into master. Give it a shot and see how it goes!