This is the second in a series of refactorings to clean up how the Kanban class gets it’s pane data. The Refactoring Using extract method again, I was able to merge #get_active and #get_testing so they both use a new method #issues_from_kanban_issue. Before 1 2 3 4 5 6 7 8 9 10 11 12 …
Tag: ruby
Daily Refactor #45: Extract Method for Kanban panes – Part 1
I’m starting on some major internal refactoring of the Kanban class now. There are seven core methods that it uses and they all contain a lot of copy and paste duplication. Today I’m starting on the Finished (#get_finished_issues) and Canceled (#get_canceled_issues) panes since they are almost mirror images. The Refactoring I used extract method with …
Daily Refactor #44: Extract Method in Kanban.
My StuffToDo plugin has now been improved and refactored quite a bit so it’s time to move onto a different plugin. Since I’m starting to do a lot of work in the Kanban plugin again, refactoring that plugin would be extremely useful. The Refactoring The first step I use when refactoring a new codebase is …
Daily Refactor #43: Extract Method in StuffToDoController
The Refactoring Today I used extract method to start cleaning up the new TimeGrid code I recently merged into the StuffToDo plugin. Before 1 2 3 4 5 # app/controllers/stuff_to_do_controller.rb class StuffToDoController "#{Issue.table_name}.id ASC") @time_entry = TimeEntry.new end end# app/controllers/stuff_to_do_controller.rb class StuffToDoController "#{Issue.table_name}.id ASC") @time_entry = TimeEntry.new end end After 1 2 3 4 5 …
Daily Refactor #42: Consolidate Conditionals in StuffToDo#available
Last night I merged a large work in progress branch into StuffToDo so the refactoring I wanted to do wasn’t available anymore. But there’s always a replacement to be found (aka: always some bad code to fix). The Refactoring A few days ago I did some refactoring to StuffToDo#available in order to remove some of …