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 …
Tag: 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 …
Daily Refactor #2: Move Method in the BulkTimeEntriesController – saving a new TimeEntry
The Refactoring Following up to yesterday’s refactoring, today I kept refactoring the Bulk Time Entry plugin’s controller. The save_time_entry_from_params method I extracted yesterday only uses the TimeEntry class, so it would be perfect to move the method to the TimeEntry class. Since the TimeEntry class is defined by Redmine, I had to monkey-patch that class. …
Daily Refactor #1: Extract Method in the BulkTimeEntriesController – saving a new TimeEntry
I’m having two problems right now: Not enough time to write to my blogs Not enough time to keep my Redmine plugins maintained To try and fix both of these problems, I’m going to try and start something new here: a daily refactoring. I’m going do a small refactoring to my Redmine plugins or Redmine …