This'll make uri_require a nice safe place to live.... sort of.

require 'open-uri'

module UriRequire
	Version = '0.1.1'
	
	@@orig_require = Kernel.method :require
	
	def self.orig_require; @@orig_require; end
end

def require( library_name )
	if library_name =~ /^(http|https|ftp):\/\//
	    uri_require( library_name )
	else
          UriRequire.orig_require.call library_name
	end
end

def uri_require( library_name, expected_digest )
	begin
		contents = open( library_name ) do |f| f.gets( nil );
end
	rescue OpenURI::HTTPError
		library_name += '.rb'
		contents = open( library_name ) do |f| f.gets( nil );
end
	end
	require 'digest/sha1'
	digest = Digest::SHA1.hexdigest('xx')
	if expected_digest
	   raise "Wrong Hash - Expected '#{expected_digest}', recieved
'#{digest}'"
	else
	   warn "Requiring a uri without a hash? Are you freakin'
crazy?"
	   warn "The hash is '#{digest}' for '#{library_name}'"
	end
	eval contents
end 

#####################################################################################
This email has been scanned by MailMarshal, an email content filter.
#####################################################################################