Files
metasploit-gs/lib/rex/script.rb
T
HD Moore c1609d0db1 Woops!
git-svn-id: file:///home/svn/framework3/trunk@8631 4d416f70-5f16-0410-b530-b9f4589650da
2010-02-24 23:15:01 +00:00

43 lines
646 B
Ruby

#!/usr/bin/env ruby
module Rex
###
#
# This class provides an easy interface for loading and executing ruby
# scripts.
#
###
module Script
class Completed < ::RuntimeError
end
#
# Reads the contents of the supplied file and exeutes them.
#
def self.execute_file(file, in_binding = nil)
str = ''
buf = ::File.read(file, ::File.size(file))
execute(buf, in_binding)
end
#
# Executes arbitrary ruby from the supplied string.
#
def self.execute(str, in_binding = nil)
begin
eval(str, in_binding)
rescue Completed
end
end
end
end
require 'rex/script/base'
require 'rex/script/shell'
require 'rex/script/meterpreter'