This week I’m planning to do some refactoring on Redmine’s code base. Today I fixed a smell that Caliper found with flay. The Refactoring Redmine has several model objects that generate Events, which are listed on it’s Activity Page and cause email notifications to be sent. A few of these models had identical recipients methods …
Category: Articles
Sinatra Todo – a web frontend to a plain text todo file
I wanted to share an application I created that I’ve been using for a few months called Sinatra Todo. Why I built it I’ve been using GTD and other time management systems for several years now and have seen myself go through two stages: Using high tech, shiney, whiz-bang gadgets to track my todo list. …
Daily Refactor #5: Remove iteration by using Enumerable
Today is another simple refactoring to the BulkTimeEntry plugin’s helper. A common function is needing to sort one set of data into two different sets. The quick and dirty way is to just loop over each item in the set and build up the two sets yourself. But Ruby’s Arrays have another way… The Refactoring …
Daily Refactor #4: Extract Method in the BulkTimeEntriesHelper – options generator
Today Devver team showed me a new feature they added to their Caliper project, the flay code view. I liked it so much I used it on today’s BulkTimeEntry plugin refactoring. The Refactoring Flay is a tool that checks for duplicated Ruby code. The BulkTimeEntry plugin only showed one piece of code that was duplicated …
Daily Refactor #3: Behavior Change in the Bulk Time Entry patch
Today’s “refactoring” isn’t a refactoring in the classic sense, since it includes a behavior change. But if you squint your eyes enough to only see the Controller as the “public interface”, then we can call it a refactor. The Refactoring Yesterday I moved the create_bulk_time_entry into the TimeEntry class where it fit better. Today I …