Sha256: 3e1ecfda53479464c482fcb7ec4fc9ae7ee9518e50870bebfc989e70c526af68

Contents?: true

Size: 809 Bytes

Versions: 1

Compression:

Stored size: 809 Bytes

Contents

<% begin %>
  <% irb = IRB::Irb.new nil, StringInputMethod.new(script + "\n") %>
  <% IRB.conf[:MAIN_CONTEXT] = irb.context %>
  <% IRB.conf[:OUTPUT] = [] %>

  <% begin %>
    <% irb.eval_input %>
    <% IRB.Output.each do |key, line| %>
      <% case key
         when :stdin %>
        <p class="text-info"><%= h line %></p>
      <% when :stdout %>
        <p><%= h line %></p>
      <% when :stderr %>
        <p class="text-danger"><%= h line %></p>
      <% end %>
    <% end %>
  <% rescue => error %>
    <p class="text-danger"><%= h error.class %>: <%= h error.message %></p>
    <% error.backtrace.each do |backtrace| %>
      <p class="text-danger">    <%= h backtrace %></p>
    <% end %>
  <% end %>

<% rescue => error %>
  <%= erb :error, locals: { error: error }, layout: false %>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tailog-0.5.9 app/views/script/ruby_debug.erb