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 …
Category: Articles
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 #11 – Rack::Staging
I’m looking at the Rack::Staging middleware today. This middleware looks like a great idea for staging servers, since it requires all requests to have a valid staging code (cookie). If a user doesn’t have one yet, you can create an HTML page that lets them submit their staging code. The Code 1 2 3 4 …
17 Rack Middlewares I want to use
Since I’ve reviewed five different Rack middlewares this week, I thought it would be useful to list the other ones I’m interested in. Some are great for production deployments, some are great for development, and some are just plain silly. DbIndexes – shows the database indexes used by ActiveRecord on the page. OnlyForMe – simple …
Daily Code Reading #10 – Rack::ForceDomain
Today’s coderack.org middleware is Rack::ForceDomain. This middleware forces all requests to go to a single domain. This is useful to unite the “www.example.com” and “example.com” domains so they all end up at a single domain. The Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 …