« Return to Thread: Sharing: dont_repeat_yourself plugin, will report duplicate lines in your code!

Sharing: dont_repeat_yourself plugin, will report duplicate lines in your code!

by 21croissants :: Rate this Message:

Reply to Author | View in Thread

I wrote a Rails plugin which uses simian to look for duplicates lines in your code and reports in html format, Textmate or Netbeans.

I wrote it using RSpec and I have included a RSpec custom matcher:
it { rails_application.
with_threshold_of_duplicate_lines(4).
  should be_DRY }

If you use Autotest, your specs will fail the next time you do a nasty copy-paste !!!

More details in http://21croissants.blogspot.com/2008/03/dry.html

Feedback and patches (with specs!) welcome ;-)

Jean-Michel

 « Return to Thread: Sharing: dont_repeat_yourself plugin, will report duplicate lines in your code!