module Arachni::Framework::Parts::State::ClassMethods

Public Instance Methods

reset() click to toggle source

@note You should first reset {Arachni::Options}.

Resets everything and allows the framework environment to be re-used.

# File lib/arachni/framework/parts/state.rb, line 49
def reset
    Arachni::State.clear
    Arachni::Data.clear

    Arachni::Platform::Manager.reset
    Arachni::Check::Auditor.reset
    ElementFilter.reset
    Element::Capabilities::Auditable.reset
    Element::Capabilities::Analyzable.reset
    Arachni::Check::Manager.reset
    Arachni::Plugin::Manager.reset
    Arachni::Reporter::Manager.reset
    HTTP::Client.reset
end
restore( afs, &block ) click to toggle source

@param [String] afs

Path to an `.afs.` (Arachni Framework Snapshot) file created by
{#suspend}.

@return [Framework]

Restored instance.
# File lib/arachni/framework/parts/state.rb, line 30
def restore( afs, &block )
    framework = new
    framework.restore( afs )

    if block_given?
        begin
            block.call framework
        ensure
            framework.clean_up
            framework.reset
        end
    end

    framework
end