<commit_before># rails_best_practices

[![Build Status](https://secure.travis-ci.org/railsbp/rails_best_practices.png)](http://travis-ci.org/railsbp/rails_best_practices)

[![Coderwall Endorse](http://api.coderwall.com/flyerhzm/endorsecount.png)](http://coderwall.com/flyerhzm)

[![Click here to lend your support to: rails best practices and make a donation at www.pledgie.com !](http://www.pledgie.com/campaigns/12057.png?skin_name=chrome)](http://www.pledgie.com/campaigns/12057)

rails_best_practices is a code metric tool to check the quality of rails codes.

it supports following ORM/ODMs:

* activerecord
* mongoid
* mongomapper

following template engines:

* erb
* haml
* slim

rails_best_practices works well only in ruby 1.9.2 and ruby 1.9.3 so far.

## External Introduction

<http://ruby5.envylabs.com/episodes/257-episode-253-march-9th-2012/stories/2253-rails_best_practices>
<http://railscasts.com/episodes/252-metrics-metrics-metrics>

## Usage

At the root directory of rails app

    rails_best_practices .

or html output

    rails_best_practices -f html .

By default rails_best_practices will do parse codes in vendor, spec, test and features directories. If you need, see the command options:

    $ rails_best_practices -h<commit_msg>update README to say we support rabl<commit_after># rails_best_practices

[![Build Status](https://secure.travis-ci.org/railsbp/rails_best_practices.png)](http://travis-ci.org/railsbp/rails_best_practices)

[![Coderwall Endorse](http://api.coderwall.com/flyerhzm/endorsecount.png)](http://coderwall.com/flyerhzm)

[![Click here to lend your support to: rails best practices and make a donation at www.pledgie.com !](http://www.pledgie.com/campaigns/12057.png?skin_name=chrome)](http://www.pledgie.com/campaigns/12057)

rails_best_practices is a code metric tool to check the quality of rails codes.

it supports following ORM/ODMs:

* activerecord
* mongoid
* mongomapper

following template engines:

* erb
* haml
* slim
* rabl

rails_best_practices works well only in ruby 1.9.2 and ruby 1.9.3 so far.

## External Introduction

<http://ruby5.envylabs.com/episodes/257-episode-253-march-9th-2012/stories/2253-rails_best_practices>
<http://railscasts.com/episodes/252-metrics-metrics-metrics>

## Usage

At the root directory of rails app

    rails_best_practices .

or html output

    rails_best_practices -f html .

By default rails_best_practices will do parse codes in vendor, spec, test and features directories. If you need, see the command options:

    $ rails_best_practices -h
{'fraction_non_alphanumeric': 0.108712715855573, 'fraction_numerical': 0.027472527472527472, 'mean_word_length': 4.753950338600451, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3536955', 'n_tokens_mistral': 993, 'n_tokens_neox': 880, 'n_words': 212}