Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #94 from wapcaplet/93-right-align-line-numbers

Issue #93: Right-justify line numbers
  • Loading branch information...
commit 66a5bf5d76c4312a62862a86e048731203669961 2 parents c96ab56 + 3d1eca6
@abedra abedra authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/rcov/templates/detail.html.erb
View
7 lib/rcov/templates/detail.html.erb
@@ -39,9 +39,9 @@
</tbody>
</table>
</div>
-
+
<h3>Key</h3>
-
+
<div class="key"><pre><span class='marked'>Code reported as executed by Ruby looks like this...</span><span class='marked1'>and this: this line is also marked as covered.</span><span class='inferred'>Lines considered as run by rcov, but not reported by Ruby, look like this,</span><span class='inferred1'>and this: these lines were inferred by rcov (using simple heuristics).</span><span class='uncovered'>Finally, here's a line marked as not executed.</span></pre></div>
<h3>Coverage Details</h3>
@@ -51,8 +51,9 @@
<% fileinfo.num_lines.times do |i| %>
<% line = fileinfo.lines[i].chomp %>
<% count = fileinfo.counts[i] %>
+ <% width = fileinfo.num_lines.to_s.length %>
<tr class="<%= line_css(i) %>">
- <td><pre><a name="line<%= i.next %>"><%= i.next %></a> <%= CGI::escapeHTML(line) %></pre></td>
+ <td><pre><a name="line<%= i.next %>"><%= i.next.to_s.rjust(width) %></a> <%= CGI::escapeHTML(line) %></pre></td>
</tr>
<% end %>
</tbody>
Please sign in to comment.
Something went wrong with that request. Please try again.