生成HTML格式的文档
rake doc:app
检查编写的代码量
rake stats
mactekiMacBook-Pro-3:depot mac$ rake doc:app
rm -r doc/app
Parsing sources...
100% [26/26] app/models/user.rb
Generating Darkfish format into /Users/mac/MyProjects/depot/doc/app...
Files: 26
Classes: 16 (16 undocumented)
Modules: 9 ( 9 undocumented)
Constants: 1 ( 1 undocumented)
Attributes: 2 ( 2 undocumented)
Methods: 55 (17 undocumented)
Total: 83 (45 undocumented)
45.78% documented
Elapsed: 1.2s
mactekiMacBook-Pro-3:depot mac$ rake stats
+----------------------+-------+-------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers | 565 | 380 | 9 | 46 | 5 | 6 |
| Helpers | 24 | 24 | 0 | 1 | 0 | 22 |
| Models | 133 | 98 | 5 | 10 | 2 | 7 |
| Mailers | 29 | 15 | 2 | 2 | 1 | 5 |
| Javascripts | 40 | 0 | 0 | 0 | 0 | 0 |
| Libraries | 0 | 0 | 0 | 0 | 0 | 0 |
| Controller tests | 396 | 256 | 8 | 0 | 0 | 0 |
| Helper tests | 0 | 0 | 0 | 0 | 0 | 0 |
| Model tests | 117 | 70 | 5 | 1 | 0 | 68 |
| Mailer tests | 35 | 11 | 2 | 2 | 1 | 3 |
| Integration tests | 59 | 4 | 1 | 0 | 0 | 0 |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total | 1398 | 858 | 32 | 62 | 1 | 11 |
+----------------------+-------+-------+---------+---------+-----+-------+
Code LOC: 517 Test LOC: 341 Code to Test Ratio: 1:0.7