% begin %> <% binding = Object.new.send :binding %> <% script.each_line do |line| %> <% next if line.strip.empty? %>
> <%= h line %>
<% begin %> <% result = binding.eval(line).inspect %>=> <%= h result %>
<% rescue => error %><%= h error.class %>: <%= h error.message %>
<% break %> <% end %> <% end %> <% rescue => error %> <%= erb :error, locals: { error: error }, layout: false %> <% end %>