I’m looking at flay’s #expand_dirs_to_files today. This method takes a list of files and directories and will recursively walk them to collect all of the Ruby source files that need to be analyzed. The Code 1 2 3 4 5 6 7 8 9 10 11 def self.expand_dirs_to_files *dirs extensions = ['rb'] + Flay.load_plugins …
Tag: metrics
Daily Code Reading #12 – Flay executable
This week I’m looking at some of the metrics libraries included in metric_fu. Since these libraries analyze Ruby code, I suspect that I’ll find some very interesting Ruby inside them. I’m starting with flay, a library that analyzes code for duplication and structural similarities. Since flay includes a command line executable, I’m starting with that …
Daily Code Reading #8 – Rack::GoogleAnalytics
Today I’m reading the code for Rack::GoogleAnalytics. It’s rack middleware I found on coderack.org that will automatically insert the Google Analytics tracking code into every page. The Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 …
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 …