This project is archived and is in readonly mode.

#6278 new
Joseph Holsten

Seperate CodeStatistics Rendering from Calculation

Reported by Joseph Holsten | January 11th, 2011 @ 03:59 PM

CodeStatistics is wonky. It's to_s actually just fires a bunch of puts, and there's no good way to get at the data if you want to present it differently. This patch separates CodeStatistics from the printing. I needed this to render a code stats in a web page for https://github.com/dhh/conductor, so I've merged this back in.

Also, this should make it easier to test #2299 and the spec bit in #4164.

Includes patch and test.

Comments and changes to this ticket

  • Dan Pickett

    Dan Pickett March 12th, 2011 @ 04:11 PM

    I dig the approach, and it applies cleanly to edge.

    But, isn't the correlating test a bit brittle in the sense that any changes to the test application will cause your test to fail? I'm not sure I can suggest a better alternative, but I can see this as a potential annoyance when making significant changes to railties.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Pages