Sha256: 4820324a40fe7f1156da8fb29ccf3d12028cc2df5e022415503f32338b9ca916

Contents?: true

Size: 671 Bytes

Versions: 2

Compression:

Stored size: 671 Bytes

Contents

#!/usr/bin/env ruby
# -*- coding: binary -*-

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'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
librex-0.0.68 lib/rex/script.rb
librex-0.0.66 lib/rex/script.rb