Skip to content

Commit

Permalink
Issue relevance#93: Right-justify line numbers
Browse files Browse the repository at this point in the history
This commit causes the line numbers in HTML source listings to be
right-justified, allowing the code indentation to appear more
consistent.
  • Loading branch information
wapcaplet committed Mar 9, 2012
1 parent c96ab56 commit 3d1eca6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/rcov/templates/detail.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down

0 comments on commit 3d1eca6

Please sign in to comment.