Dead code has no reason to be in a project. Dead code wastes a developer’s time and energy. Going from this it makes sense to remove the dead code and put it rest with a delete keystroke. The main problem is how to identify dead code in a living project?
RailsRequestStats provides a simple drop-in solution to expose more statistics on requests. New information is presented in your development logs, supplying you with the required information to iteratively optimize requests by noticing subtle changes in the number of queries and average runtimes.
A little history on my website, and the underlying framework I have used -- Middleman. I walkthrough the process on how I deploy the website to GitHub pages using a deployment script.
ActiveJob in Rails provides nice benefits. The background queueing gem Sidekiq allows for tailored options that you cannot use with ActiveJob. This post looks at a project's transition from ActiveJob to Sidekiq, and how to fill the missing functionality of ActiveJob Callbacks. By the end, we come up with a way to contain the callback logic to their own modules without modifying the concrete jobs.
When you are knee deep in Ruby and dealing with objects that you never created it's sometimes a little daunting to trace everything back and figure it all out. Luckly there are a couple techniques in Ruby that can aid you. In particular, pry is an extreamly powerful tool that you should have in your toolbox.
In a large long-lived git repository there is a lot of history behind the current state of things. git blame lets you scratch the surface, while git log lets you dig deeper. The use of git evolution provides a succient and yet comprhensive approach to understanding the evolution of a range of lines within a git repository.
As a developer its not uncommon to juggle multiple servers that interact with each other during development. Ensuring that each server has the correct port set while working off of localhost is a cumbersome and error prone issue. port_map is a ruby utility that provides a simple and almost automatic solution to this problem.
Do you define methods within your Rake tasks? You might want to reconsider that, or you're gonna have a bad time down the road. Walkthrough an example which illustrates a tricky gotcha and solutions to avoiding it.
Explore two approaches for testing along with a suggested workflow. The goal is to improve the time spent during regression testing. The described technique can apply to other testing frameworks, assuming they have similar mechanisms to RSpec's it blocks.
RSpec 3.0 introduces new verifying doubles that offer the ability to verify received messages against the underlying class/object. Learn how using verifying doubles offer more robust tests with little effort.