Sha256: 2d5753f25687110a9e9ab432d855e9847c5d8a7facf4c5b8acef0e6442426547

Contents?: true

Size: 1.9 KB

Versions: 6

Compression:

Stored size: 1.9 KB

Contents

=begin
    Copyright 2010-2015 Tasos Laskos <tasos.laskos@arachni-scanner.com>

    This file is part of the Arachni Framework project and is subject to
    redistribution and commercial restrictions. Please see the Arachni Framework
    web site for more information on licensing and terms of use.
=end

class Arachni::Reporters::HTML

# @author Tasos "Zapotek" Laskos <tasos.laskos@arachni-scanner.com>
class PluginFormatters::Exec < Arachni::Plugin::Formatter
    include TemplateUtilities

    def run
        ERB.new( tpl ).result( binding )
    end

    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

end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
arachni-1.3.2 components/reporters/plugin_formatters/html/exec.rb
arachni-1.3.1 components/reporters/plugin_formatters/html/exec.rb
arachni-1.3 components/reporters/plugin_formatters/html/exec.rb
arachni-1.2.1 components/reporters/plugin_formatters/html/exec.rb
arachni-1.2 components/reporters/plugin_formatters/html/exec.rb
arachni-1.1 components/reporters/plugin_formatters/html/exec.rb