TIL is my collection of short, technical daily learnings. 196 and counting.
Finding Getters
After writing the other day about why you might not want to use simple getters, I decided that I wanted to eliminate all such methods from a project. Here is the regex I wrote to isolate the pattern: ag 'def (\w+);?\s+@\1;?\s+end' The semicolon catches one-line getter methods as well as the more common three-line.