Hi everyone,
At the end-of-the-year drinkup in December, someone mentioned they'd like to see some Ruby code from experienced developers, and have the group discuss it on the mailing list. In order to kick this off, I made a gist of some code I wrote recently:
In a nutshell, this is a single method that takes an
iCal daily recurrence string and rewrites the start and/or end times based on the current sunrise / sunset times in a specific location. The method is part of a Condition class that is used as criteria for triggering an event. Here's an example use case:
If I arrive home between sunrise and sunset in Ann Arbor, MI, open all of my living room shades.
I chose this example not because it's necessarily ideal code, but because I think it has some interesting design decisions that would make for good discussion.
You are all welcome to comment on the code; feel free to ask questions or highlight specific sections that you like / dislike. Alternative approaches / philosophies are encouraged! Please use Github for comments related to the code, as it is much better suited for this purpose than email.
* * *
I'd like to see at least two other experienced Ruby developers volunteer some code. Who's game?
Cory