Assess the "style" of Cookbooks Using the 'tailor' Gem - nshenry03/chef-repo GitHub Wiki
tailor parses Ruby files and measures them with some style and static analysis "rulers". Default values for the Rulers are based on a number of style guides in the Ruby community as well as what seems to be common. More on this here http://wiki.github.com/turboladen/tailor. tailor's goal is to help you be consistent with your code, throughout your project, whatever style that may be.
You can test all of the ruby files in a cookbook with the following command:
tailor $(find [cookbook_path] -type f -name "*.rb")
So, for example, I could test my 'base-logic' cookbook with the following command:
tailor $(find ../cookbooks/base-logic -type f -name "*.rb")
This outputs the following:
#------------------------------------------------------------------------------#
# Tailor Summary |
#------------------------------------------------------------------------------#
# File | Probs |
#------------------------------------------------------------------------------#
# ../cookbooks/base-logic/metadata.rb | 0 |
# ../cookbooks/base-logic/recipes/default.rb | 0 |
#------------------------------------------------------------------------------#
# TOTAL | 0 |
#------------------------------------------------------------------------------#
I could also test all of my cookbooks with the following command:
tailor $(find ../cookbooks -type f -name "*.rb")