Sha256: 782faf71ad715c94d1ebebfb14e01938680eb8492f1cfbb77f303647b0848a5c

Contents?: true

Size: 812 Bytes

Versions: 5

Compression:

Stored size: 812 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

5 entries across 5 versions & 1 rubygems

Version Path
tailog-0.5.8 app/views/script/ruby_debug.erb
tailog-0.5.7 app/views/script/ruby_debug.erb
tailog-0.5.6 app/views/script/ruby_debug.erb
tailog-0.5.5 app/views/script/ruby_debug.erb
tailog-0.5.4 app/views/script/ruby_debug.erb