Parent

Class/Module Index [+]

Quicksearch

Rex::Script::Base

Attributes

args[RW]
client[RW]
error[RW]
framework[RW]
path[RW]
session[RW]
sink[RW]
workspace[RW]

Public Class Methods

new(client, path) click to toggle source
# File lib/rex/script/base.rb, line 16
def initialize(client, path)
        self.client    = client
        self.framework = client.framework
        self.path      = path
        self.sink      = OutputSink.new

        if(client.framework.db and client.framework.db.active)
                self.workspace = client.framework.db.find_workspace( client.workspace.to_s ) || client.framework.db.workspace
        end

        # Convenience aliases
        self.session   = self.client
end

Public Instance Methods

completed() click to toggle source
# File lib/rex/script/base.rb, line 34
def completed
        raise Rex::Script::Completed
end
output() click to toggle source
# File lib/rex/script/base.rb, line 30
def output
        client.user_output || self.sink
end
run(args=[]) click to toggle source
# File lib/rex/script/base.rb, line 38
def run(args=[])
        self.args = args = args.flatten
        begin
                eval(::File.read(self.path, ::File.size(self.path)), binding )
        rescue ::Interrupt
        rescue ::Rex::Script::Completed
        rescue ::Exception => e
                self.error = e
                raise e
        end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.