rails_best_practices
https://github.com/flyerhzm/rails_best_practices
Ruby
a code metric tool for rails projects
RailsBestPractices::Reviews::LawOfDemeterReview#need_delegate?
check if the call node can use delegate to avoid violating law of demeter. if the receiver of receiver of the call node matchs any in model names, and the message of receiver of the call node matchs any in association names, then it needs delegate.
Edit
git clone [email protected]:flyerhzm/rails_best_practices.git
cd rails_best_practices
open lib/rails_best_practices/reviews/law_of_demeter_review.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-RailsBestPractices--Reviews--LawOfDemeterReview-need_delegate--for-pr
# Commit to gitgit add lib/rails_best_practices/reviews/law_of_demeter_review.rbgit commit -m "better docs for RailsBestPractices::Reviews::LawOfDemeterReview#need_delegate?"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-RailsBestPractices--Reviews--LawOfDemeterReview-need_delegate--for-pr
hub pull-request
# Celebrate!