Skip to content

Commit

Permalink
updating documentation for 2.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Scruggs committed Nov 10, 2010
1 parent 665485a commit 5a97099
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 38 deletions.
5 changes: 5 additions & 0 deletions HISTORY
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
=== MetricFu 2.0.0 / 2010-11-10

* Hotspots - Dan Mayer, Ben Brinckerhoff, Jake Scruggs
* Rcov integration with Hotspots - Jake Scruggs, Tony Castiglione, Rob Meyer

=== MetricFu 1.5.1 / 2010-7-28

* Patch that allows graphers to skip dates that didn't generate metrics for that graph (GitHub Issue #20). - Chris Griego
Expand Down
13 changes: 7 additions & 6 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ See http://metric-fu.rubyforge.org/ for documentation, or the HISTORY file for a
How to contribute:

1. Fork metric_fu on github.
2. 'gem install metric_fu --development' #to get development dependencies
3. Run the tests ('rake')
4. Run metric_fu on itself ('rake metrics:all')
5. Make the changes you want and back them up with tests.
6. Make sure two important rake tests still run ('rake' and 'rake metrics:all')
7. Commit and send me a pull request with details as to what has been changed.
2. 'gem install metric_fu' #to get gem dependencies
3. Install the gems RSpec 1.3.0, test-construct, and googlecharts
4. Run the tests ('rake')
5. Run metric_fu on itself ('rake metrics:all')
6. Make the changes you want and back them up with tests.
7. Make sure two important rake tests still run ('rake' and 'rake metrics:all')
8. Commit and send me a pull request with details as to what has been changed.

Extra Credit:
1. Make sure your changes work in 1.8.7, Ruby Enterprise Edition, and 1.9.1 (Hint use 'rvm' to help install multiple rubies)
Expand Down
Binary file added home_page/hotspot.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 34 additions & 32 deletions home_page/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h2>Links</h2>
<!-- end #sidebar -->
</div>
<div id="left">
<h1>About metric_fu 1.5.1</h1>
<h1>About metric_fu 2.0.0</h1>
<div>
<p><br/>
Metric_fu is a set of rake tasks that make it easy to generate metrics reports. It uses
Expand All @@ -71,51 +71,31 @@ <h1>About metric_fu 1.5.1</h1>
</p>
<br/>
<p>
In 1.5.0 I re-wrote the Flog parsing engine to use Flog programmatically instead of parsing the command line output. This will hopefully stop minor changes in Flog's output from breaking metric_fu. Check the <a href="http://github.com/jscruggs/metric_fu/blob/master/HISTORY">HISTORY</a> file for complete details.
In 2.0.0 the big new feature is Hotspots. The Hotspots report combines Flog, Flay, Rcov, Reek, Roodi, and Churn numbers into one report so you see parts of your code that have multiple problems like so:
</p>
<img src="hotspot.gif" width="359">
<p>
That is one terrible method.<br/>
Big thanks to Dan Mayer and Ben Brinckerhoff for the Hotspots code and for helping me integrate it with RCov.
</p>
<br/>

<p>
New in metric_fu 1.4.0 is integration with the rails_best_practices gem (Richard Huang), Rails stats now have graphing (Josh Cronemeyer), parameterized filetypes for flay so it can look at other file types (bfabry), along with many bug fixes.
In 1.5.0 I re-wrote the Flog parsing engine to use Flog programmatically instead of parsing the command line output. This will hopefully stop minor changes in Flog's output from breaking metric_fu. Check the <a href="http://github.com/jscruggs/metric_fu/blob/master/HISTORY">HISTORY</a> file for complete details.
</p>
<br/>
<p>
In metric_fu 1.3.0 is the ability to configure what RAILS_ENV you what Rcov to run under so it won't clobber any other tests that might be running (in continuous integration). You can also configure the minimum Flay score to record (the default minimum score 100). There's now some cool tooltip hover info in the graphs (thanks Édouard Brière).
New in metric_fu 1.4.0 is integration with the rails_best_practices gem (Richard Huang), Rails stats now have graphing (Josh Cronemeyer), parameterized filetypes for flay so it can look at other file types (bfabry), along with many bug fixes.
</p>
<br/>

<h2>Installation:</h2>
<pre>sudo gem install metric_fu</pre>
<pre>gem install metric_fu</pre>
<br/>
<p>Then in your Rakefile:</p>
<br/>
<pre>require 'metric_fu'</pre>
<br/>
<p>
If you like to vendor gems, you can unpack metric_fu into vendor/gems and require it like so:
</p>
<br/>
<pre>require(File.join(RAILS_ROOT, 'vendor', 'gems', 'metric_fu-1.5.1', 'lib', 'metric_fu'))</pre>
<br/>
<p>Then you don't have to install it on every box you run it on.</p>
<br/>
<p>Later versions of Rails like to manage your gems for you, so you can put this in your test.rb file:</p>
<br/>
<pre>config.gem 'metric_fu', :version => '1.5.1', :lib => 'metric_fu'</pre>
<br/>
<p>And then issue this command:</p>
<br/>
<pre>
$ rake gems:unpack RAILS_ENV=test
</pre>
<br/>
<p>That way Rails won't yell at you every time you run a Rake task:</p>
<br/>
<pre>
config.gem: Unpacked gem metric_fu-1.5.1 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
</pre>
<br/>
<p>
I hate being yelled at.
</p>

<h2>Output:</h2>
<table>
Expand Down Expand Up @@ -170,6 +150,25 @@ <h2>Graphing</h2>
MetricFu uses Bluff for graphing (a Javascript library) by default. If you'd rather use Google Charts you can set 'config.graph_engine = :gchart' in the config. You'll have to install the googlecharts gem, of course.
</p>

<p><br/>
<h2>Notes on Rails 3</h2>
If you use RSpec, you'll need to add this to one of your rake files:
<pre>
require 'metric_fu'
MetricFu::Configuration.run do |config|
config.rcov[:test_files] = ['spec/**/*_spec.rb']
config.rcov[:rcov_opts] << "-Ispec" # Needed to find spec_helper
end
</pre>
If you're using default Rails testing, then you can do this:
<pre>
require 'metric_fu'
MetricFu::Configuration.run do |config|
config.rcov[:rcov_opts] << "-Itest" # Needed to find test_helper
end
</pre>
<br/>

<p><br/>
<h2>Notes on metrics:coverage</h2>
When creating a coverage report, metric_fu runs all the tests in the test folder and specs in spec folder using Rcov. You can configure what files it should run and the RAILS_ENV (by setting 'environment') it runs under. Default config for rcov:
Expand All @@ -187,6 +186,7 @@ <h2>Notes on metrics:coverage</h2>
:external => nil
}
</pre>
By far, Rcov is the most troublesome report in metric_fu. This is not because of Rcov itself, but because the Rcov report has to actually execute your tests and test suites can be very tricky things. MetricFu naively shells out to the command line, runs rcov on your tests/specs, and captures the output. This does not always work well. If you are having problems with metric_fu, try turning off Rcov (see the above Configuration section).
</p>
<p><br/>
<h2>Notes on metrics:saikuro</h2>
Expand Down Expand Up @@ -256,6 +256,8 @@ <h2>Notes on metrics:churn</h2>
<br/>
<br/>
</p>


<br/>
<p>Metric_fu began its life as a plugin for Rails that generated code metrics reports. As of version 0.7.0, metric_fu is a gem (owing to the excellent work done by Sean Soper) and is hosted on GitHub at <a href="http://github.com/jscruggs/metric_fu">http://github.com/jscruggs/metric_fu</a>. </p>
<p><br/>
Expand Down

0 comments on commit 5a97099

Please sign in to comment.