Skip to content

Commit

Permalink
Merge pull request #347 from sj26/hide-variables-unless-binding-of-ca…
Browse files Browse the repository at this point in the history
…ller

Hide variables unless we have binding_of_caller
  • Loading branch information
Charlie Somerville committed Jun 24, 2016
2 parents f8aa9af + 9aae9be commit d285ecf
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions lib/better_errors/templates/variable_info.erb
Expand Up @@ -45,26 +45,28 @@
</div>
</div>

<div class="sub">
<h3>Local Variables</h3>
<div class='inset variables'>
<table class="var_table">
<% @frame.local_variables.each do |name, value| %>
<tr><td class="name"><%= name %></td><td><pre><%== inspect_value value %></pre></td></tr>
<% end %>
</table>
<% if BetterErrors.binding_of_caller_available? && @frame.frame_binding %>
<div class="sub">
<h3>Local Variables</h3>
<div class='inset variables'>
<table class="var_table">
<% @frame.local_variables.each do |name, value| %>
<tr><td class="name"><%= name %></td><td><pre><%== inspect_value value %></pre></td></tr>
<% end %>
</table>
</div>
</div>
</div>

<div class="sub">
<h3>Instance Variables</h3>
<div class="inset variables">
<table class="var_table">
<% @frame.instance_variables.each do |name, value| %>
<tr><td class="name"><%= name %></td><td><pre><%== inspect_value value %></pre></td></tr>
<% end %>
</table>
<div class="sub">
<h3>Instance Variables</h3>
<div class="inset variables">
<table class="var_table">
<% @frame.instance_variables.each do |name, value| %>
<tr><td class="name"><%= name %></td><td><pre><%== inspect_value value %></pre></td></tr>
<% end %>
</table>
</div>
</div>
</div>

<!-- <%= Time.now.to_f - @var_start_time %> seconds -->
<!-- <%= Time.now.to_f - @var_start_time %> seconds -->
<% end %>

0 comments on commit d285ecf

Please sign in to comment.