Sha256: a6bd790185153d4641a086aa9102713e4e8d92aa81ab4933fa299d6f8000e9a3

Contents?: true

Size: 1.36 KB

Versions: 7

Compression:

Stored size: 1.36 KB

Contents

=begin
    Copyright 2010-2013 Tasos Laskos <tasos.laskos@gmail.com>

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
=end

class Arachni::Plugins::SpiderHook < Arachni::Plugin::Base

    is_distributable

    def prepare
        framework.pause
        @urls = []
    end

    def run
        spider.on_each_page { |page| @urls << page.url }
    end

    def clean_up
        framework.resume
        wait_while_framework_running
        sleep 1 # emulate some latency to catch race conditions
        register_results( framework.self_url => @urls )
    end

    def self.merge( results )
        results.inject( {} ) { |h, r| h.merge!( r ); h }
    end

    def self.info
        {
            name:        'SpiderHook',
            description: %q{},
            author:      'Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>',
            version:     '0.1'
        }
    end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
arachni-0.4.5.2 spec/support/fixtures/plugins/spider_hook.rb
arachni-0.4.5.1 spec/support/fixtures/plugins/spider_hook.rb
arachni-0.4.5 spec/support/fixtures/plugins/spider_hook.rb
arachni-0.4.4 spec/support/fixtures/plugins/spider_hook.rb
arachni-0.4.3.2 spec/support/fixtures/plugins/spider_hook.rb
arachni-0.4.3.1 spec/support/fixtures/plugins/spider_hook.rb
arachni-0.4.3 spec/support/fixtures/plugins/spider_hook.rb