Class: PluginFormatters::Exec

Inherits:
Arachni::Plugin::Formatter
  • Object
show all
Includes:
TemplateUtilities
Defined in:
components/reporters/plugin_formatters/stdout/exec.rb,
components/reporters/plugin_formatters/html/exec.rb,
components/reporters/plugin_formatters/xml/exec.rb

Overview

Author:

Instance Method Summary collapse

Instance Method Details

#run(xml) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'components/reporters/plugin_formatters/stdout/exec.rb', line 14

def run
    results.each do |stage, data|
        print_status "#{stage}: #{data['executable']}"
        print_info "Status:  #{data['status']}"
        print_info "PID:     #{data['pid']}"
        print_info "Runtime: #{data['runtime']}"
        print_info "STDOUT:  #{data['stdout']}"
        print_info "STDERR:  #{data['stderr']}"
    end
end

#tplObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'components/reporters/plugin_formatters/html/exec.rb', line 19

def tpl
    <<-HTML
    <ul class="nav nav-tabs">
        <% results.keys.each.with_index do |stage, i| %>
            <li <%= 'class="active"' if i == 0 %> >
                <a href="#!/plugins/exec/<%= stage %>">
                    <%= stage.capitalize %>
                </a>
            </li>
        <% end %>
    </ul>

    <div class="tab-content">
        <% results.each do |stage, data| %>
            <div class="tab-pane <%= 'active' if results.keys.first == stage %>"
                id="plugins-exec-<%= stage %>">

                <dl class="dl-horizontal">
                    <dt>Executable</dt>
                    <dd><code><%= escapeHTML data['executable'] %></code></dd>

                    <dt>Status</dt>
                    <dd><%= data['status'] %></dd>

                    <dt>PID</dt>
                    <dd><%= data['pid'] %></dd>

                    <dt>Runtime</dt>
                    <dd><%= data['runtime'] %></dd>
                </dl>

                <strong>STDOUT</strong>
                <pre><%= escapeHTML data['stdout'].to_s %></pre>

                <strong>STDERR</strong>
                <pre><%= escapeHTML data['stderr'].to_s %></pre>
            </div>
        <% end %>
    </div>
    HTML
end