It has been awhile since I have touched the time_rounder gem. When I left off, I only implemented the 15 minute schedule. I have recently started work on that gem again in an effort to commit more to open source and build up my portfolio. Here is what I have been up to with the gem.
First, I have improved the rounding schedule setup. When I started the gem I just simple used large hashes containing every minute of an hour and what it rounded to. I since found a happy medium in using Array’ min_by and a small amount of math. I may make further improvements to the code in future but I feel it is pretty good at the moment.
Next, I have improved the tests and made them easier to understand and not have so many examples by lumping common examples together. I essentially take all the minutes that round to the same number and test them in a loop, instead of repeating a test for each minute of the hour.
Lastly, I am working on the other rounding schedules. At the moment there is only the 15 minute schedule. The plan is to add 1 hour, 30 minute, 20 minute, 10 minute. and 5 minute schedule. Once all the schedules are complete the gem will move to a 1.0 release.
A couple co workers and myself registered for this hackathon to end homelessness in the St. Louis region. We are currently awaiting the true challenge of the hackathon. I will update this post more throughout the weekend.
So the hackathon is over. We didn’t win any prizes but learned several things about out team and pieces of our development process we can improve. We mainly use Ruby on Rails (Rails) as our development environment, some of the things we learned pertained to that style of development.
First, thing we learned is using generators is great, but I like my code formatted a certain way, different than the scaffold generators, generate code. This would mean we need to create our own set to use to quickly build an application. I have started a open source project for these generators, because I use Rails outside of work as well.
Second, I learned how uncomfortable I get writing code without any unit tests. I have come to believe that they are necessary, they help with not having to manually test multiple pieces of code continually. We chose not to use tests, we had parts of our app that didn’t work properly. Not sure how to feel here, I understand they take time and when you have less than 48 hours to develop a functioning app stuff gets cut. I am looking forward to build some generators, because it should help by pre generating those tests for us.
Overall it was a fun experience for my first hackathon and learned quite a bit about myself, my development skills, and my development style. I look forward to taking what I learned and improving myself over the next several months.