% begin %> <% output = IRB.evaluate_string script %> <% output.each do |key, line| %> <% case key when :stdin %>
<%= h line %>
<% when :stdout %><%= h line %>
<% when :stderr %><%= h line %>
<% end %> <% end %> <% rescue => error %> <%= erb :error, locals: { error: error }, layout: false %> <% end %>